Skip to main content

XmtpBackendClient

Trait XmtpBackendClient 

Source
pub trait XmtpBackendClient: MaybeSend + MaybeSync {
    type Error: RetryableError + MaybeSend + MaybeSync + 'static;

Show 15 methods // Required methods fn publish<'life0, 'async_trait>( &'life0 self, request: PublishRequest, ) -> Pin<Box<dyn Future<Output = Result<PublishResponse, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn create_upload<'life0, 'async_trait>( &'life0 self, request: CreateUploadRequest, ) -> Pin<Box<dyn Future<Output = Result<CreateUploadResponse, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn query<'life0, 'async_trait>( &'life0 self, request: QueryRequest, ) -> Pin<Box<dyn Future<Output = Result<QueryResponse, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn query_newest<'life0, 'async_trait>( &'life0 self, request: QueryNewestRequest, ) -> Pin<Box<dyn Future<Output = Result<QueryNewestResponse, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_inbox_ids<'life0, 'async_trait>( &'life0 self, request: GetInboxIdsRequest, ) -> Pin<Box<dyn Future<Output = Result<GetInboxIdsResponse, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn get_configuration<'life0, 'async_trait>( &'life0 self, request: GetConfigurationRequest, ) -> Pin<Box<dyn Future<Output = Result<GetConfigurationResponse, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn verify_smart_contract_wallet_signatures<'life0, 'async_trait>( &'life0 self, request: VerifySmartContractWalletSignaturesRequest, ) -> Pin<Box<dyn Future<Output = Result<VerifySmartContractWalletSignaturesResponse, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn register<'life0, 'async_trait>( &'life0 self, request: RegisterRequest, ) -> Pin<Box<dyn Future<Output = Result<RecipientState, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn unregister<'life0, 'async_trait>( &'life0 self, request: UnregisterRequest, ) -> Pin<Box<dyn Future<Output = Result<UnregisterResponse, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn update_subscriptions<'life0, 'async_trait>( &'life0 self, request: UpdateSubscriptionsRequest, ) -> Pin<Box<dyn Future<Output = Result<RecipientState, Self::Error>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; // Provided methods fn register_client_event_writer(&self, _writer: &Arc<dyn EventWriter<()>>) { ... } fn unregister_client_event_writer(&self, _writer: &Arc<dyn EventWriter<()>>) { ... } fn backend_url(&self) -> Option<&str> { ... } fn has_credential_source(&self) -> bool { ... } fn set_limits(&self, limits: Arc<LimitsConfiguration>) { ... }
}
Expand description

The backend unary RPCs. Callers own retries and chunking.

Required Associated Types§

Required Methods§

Source

fn publish<'life0, 'async_trait>( &'life0 self, request: PublishRequest, ) -> Pin<Box<dyn Future<Output = Result<PublishResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn create_upload<'life0, 'async_trait>( &'life0 self, request: CreateUploadRequest, ) -> Pin<Box<dyn Future<Output = Result<CreateUploadResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn query<'life0, 'async_trait>( &'life0 self, request: QueryRequest, ) -> Pin<Box<dyn Future<Output = Result<QueryResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn query_newest<'life0, 'async_trait>( &'life0 self, request: QueryNewestRequest, ) -> Pin<Box<dyn Future<Output = Result<QueryNewestResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_inbox_ids<'life0, 'async_trait>( &'life0 self, request: GetInboxIdsRequest, ) -> Pin<Box<dyn Future<Output = Result<GetInboxIdsResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_configuration<'life0, 'async_trait>( &'life0 self, request: GetConfigurationRequest, ) -> Pin<Box<dyn Future<Output = Result<GetConfigurationResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read what this deployment publishes about itself. Served without a credential, so it is the one call a client can make before it knows whether the deployment requires one.

Source

fn verify_smart_contract_wallet_signatures<'life0, 'async_trait>( &'life0 self, request: VerifySmartContractWalletSignaturesRequest, ) -> Pin<Box<dyn Future<Output = Result<VerifySmartContractWalletSignaturesResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn register<'life0, 'async_trait>( &'life0 self, request: RegisterRequest, ) -> Pin<Box<dyn Future<Output = Result<RecipientState, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn unregister<'life0, 'async_trait>( &'life0 self, request: UnregisterRequest, ) -> Pin<Box<dyn Future<Output = Result<UnregisterResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn update_subscriptions<'life0, 'async_trait>( &'life0 self, request: UpdateSubscriptionsRequest, ) -> Pin<Box<dyn Future<Output = Result<RecipientState, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Source

fn register_client_event_writer(&self, _writer: &Arc<dyn EventWriter<()>>)

Register this client’s public event writer with a shared credential.

Source

fn unregister_client_event_writer(&self, _writer: &Arc<dyn EventWriter<()>>)

Source

fn backend_url(&self) -> Option<&str>

The backend URL this client sends to, when the transport knows it.

The stored configuration row records the URL its copy came from, and build compares the two. A transport that cannot name a URL — a test double, for instance — returns None, and the comparison is skipped.

Source

fn has_credential_source(&self) -> bool

Whether a credential source — an auth callback or an auth handle — was configured on this transport. A transport with no auth middleware reports false and build refuses a deployment that requires authentication. Defaults to true so a test double, which has no transport stack to ask, is never the thing that refuses a build.

Source

fn set_limits(&self, limits: Arc<LimitsConfiguration>)

Install the shapes the deployment publishes, so the stream and metadata chunking that happens below ApiClientWrapper uses them too. Called once, by build, before any stream opens. A transport with nothing to chunk ignores it.

Implementations on Foreign Types§

Source§

impl<T: XmtpBackendClient + ?Sized> XmtpBackendClient for &T

Source§

type Error = <T as XmtpBackendClient>::Error

Source§

fn register_client_event_writer(&self, writer: &Arc<dyn EventWriter<()>>)

Source§

fn unregister_client_event_writer(&self, writer: &Arc<dyn EventWriter<()>>)

Source§

fn publish<'life0, 'async_trait>( &'life0 self, request: PublishRequest, ) -> Pin<Box<dyn Future<Output = Result<PublishResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn create_upload<'life0, 'async_trait>( &'life0 self, request: CreateUploadRequest, ) -> Pin<Box<dyn Future<Output = Result<CreateUploadResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn query<'life0, 'async_trait>( &'life0 self, request: QueryRequest, ) -> Pin<Box<dyn Future<Output = Result<QueryResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn query_newest<'life0, 'async_trait>( &'life0 self, request: QueryNewestRequest, ) -> Pin<Box<dyn Future<Output = Result<QueryNewestResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_inbox_ids<'life0, 'async_trait>( &'life0 self, request: GetInboxIdsRequest, ) -> Pin<Box<dyn Future<Output = Result<GetInboxIdsResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_configuration<'life0, 'async_trait>( &'life0 self, request: GetConfigurationRequest, ) -> Pin<Box<dyn Future<Output = Result<GetConfigurationResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn backend_url(&self) -> Option<&str>

Source§

fn has_credential_source(&self) -> bool

Source§

fn set_limits(&self, limits: Arc<LimitsConfiguration>)

Source§

fn verify_smart_contract_wallet_signatures<'life0, 'async_trait>( &'life0 self, request: VerifySmartContractWalletSignaturesRequest, ) -> Pin<Box<dyn Future<Output = Result<VerifySmartContractWalletSignaturesResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn register<'life0, 'async_trait>( &'life0 self, request: RegisterRequest, ) -> Pin<Box<dyn Future<Output = Result<RecipientState, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn unregister<'life0, 'async_trait>( &'life0 self, request: UnregisterRequest, ) -> Pin<Box<dyn Future<Output = Result<UnregisterResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn update_subscriptions<'life0, 'async_trait>( &'life0 self, request: UpdateSubscriptionsRequest, ) -> Pin<Box<dyn Future<Output = Result<RecipientState, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl<T: XmtpBackendClient + ?Sized> XmtpBackendClient for Box<T>

Source§

type Error = <T as XmtpBackendClient>::Error

Source§

fn register_client_event_writer(&self, writer: &Arc<dyn EventWriter<()>>)

Source§

fn unregister_client_event_writer(&self, writer: &Arc<dyn EventWriter<()>>)

Source§

fn publish<'life0, 'async_trait>( &'life0 self, request: PublishRequest, ) -> Pin<Box<dyn Future<Output = Result<PublishResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn create_upload<'life0, 'async_trait>( &'life0 self, request: CreateUploadRequest, ) -> Pin<Box<dyn Future<Output = Result<CreateUploadResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn query<'life0, 'async_trait>( &'life0 self, request: QueryRequest, ) -> Pin<Box<dyn Future<Output = Result<QueryResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn query_newest<'life0, 'async_trait>( &'life0 self, request: QueryNewestRequest, ) -> Pin<Box<dyn Future<Output = Result<QueryNewestResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_inbox_ids<'life0, 'async_trait>( &'life0 self, request: GetInboxIdsRequest, ) -> Pin<Box<dyn Future<Output = Result<GetInboxIdsResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_configuration<'life0, 'async_trait>( &'life0 self, request: GetConfigurationRequest, ) -> Pin<Box<dyn Future<Output = Result<GetConfigurationResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn backend_url(&self) -> Option<&str>

Source§

fn has_credential_source(&self) -> bool

Source§

fn set_limits(&self, limits: Arc<LimitsConfiguration>)

Source§

fn verify_smart_contract_wallet_signatures<'life0, 'async_trait>( &'life0 self, request: VerifySmartContractWalletSignaturesRequest, ) -> Pin<Box<dyn Future<Output = Result<VerifySmartContractWalletSignaturesResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn register<'life0, 'async_trait>( &'life0 self, request: RegisterRequest, ) -> Pin<Box<dyn Future<Output = Result<RecipientState, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn unregister<'life0, 'async_trait>( &'life0 self, request: UnregisterRequest, ) -> Pin<Box<dyn Future<Output = Result<UnregisterResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn update_subscriptions<'life0, 'async_trait>( &'life0 self, request: UpdateSubscriptionsRequest, ) -> Pin<Box<dyn Future<Output = Result<RecipientState, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

impl<T: XmtpBackendClient + ?Sized> XmtpBackendClient for Arc<T>

Source§

type Error = <T as XmtpBackendClient>::Error

Source§

fn register_client_event_writer(&self, writer: &Arc<dyn EventWriter<()>>)

Source§

fn unregister_client_event_writer(&self, writer: &Arc<dyn EventWriter<()>>)

Source§

fn publish<'life0, 'async_trait>( &'life0 self, request: PublishRequest, ) -> Pin<Box<dyn Future<Output = Result<PublishResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn create_upload<'life0, 'async_trait>( &'life0 self, request: CreateUploadRequest, ) -> Pin<Box<dyn Future<Output = Result<CreateUploadResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn query<'life0, 'async_trait>( &'life0 self, request: QueryRequest, ) -> Pin<Box<dyn Future<Output = Result<QueryResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn query_newest<'life0, 'async_trait>( &'life0 self, request: QueryNewestRequest, ) -> Pin<Box<dyn Future<Output = Result<QueryNewestResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_inbox_ids<'life0, 'async_trait>( &'life0 self, request: GetInboxIdsRequest, ) -> Pin<Box<dyn Future<Output = Result<GetInboxIdsResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_configuration<'life0, 'async_trait>( &'life0 self, request: GetConfigurationRequest, ) -> Pin<Box<dyn Future<Output = Result<GetConfigurationResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn backend_url(&self) -> Option<&str>

Source§

fn has_credential_source(&self) -> bool

Source§

fn set_limits(&self, limits: Arc<LimitsConfiguration>)

Source§

fn verify_smart_contract_wallet_signatures<'life0, 'async_trait>( &'life0 self, request: VerifySmartContractWalletSignaturesRequest, ) -> Pin<Box<dyn Future<Output = Result<VerifySmartContractWalletSignaturesResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn register<'life0, 'async_trait>( &'life0 self, request: RegisterRequest, ) -> Pin<Box<dyn Future<Output = Result<RecipientState, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn unregister<'life0, 'async_trait>( &'life0 self, request: UnregisterRequest, ) -> Pin<Box<dyn Future<Output = Result<UnregisterResponse, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn update_subscriptions<'life0, 'async_trait>( &'life0 self, request: UpdateSubscriptionsRequest, ) -> Pin<Box<dyn Future<Output = Result<RecipientState, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§