pub trait XmtpSharedContext{
type Db: XmtpDb;
type ApiClient: XmtpApi;
type MlsStorage: XmtpMlsStorageProvider;
type ContextReference: XmtpSharedContext<Db = Self::Db, ApiClient = Self::ApiClient, MlsStorage = Self::MlsStorage> + 'static;
Show 32 methods
// Required methods
fn context_ref(&self) -> &Self::ContextReference;
fn db(&self) -> <Self::Db as XmtpDb>::DbQuery;
fn api(&self) -> &ApiClientWrapper<Self::ApiClient>;
fn scw_verifier(&self) -> Arc<Box<dyn SmartContractSignatureVerifier>> ⓘ;
fn device_sync(&self) -> &DeviceSync;
fn fork_recovery_opts(&self) -> &ForkRecoveryOpts;
fn worker_config(&self) -> &WorkerConfig;
fn mls_storage(&self) -> &Self::MlsStorage;
fn identity(&self) -> &Identity;
fn version_info(&self) -> &VersionInfo;
fn server_configuration(&self) -> &ServerConfigurationHandle;
fn worker_events(&self) -> &Sender<SyncWorkerEvent>;
fn local_events(&self) -> &Sender<LocalEvents>;
fn delivery_owner(&self) -> &Mutex<Option<DeliveryOwner>>;
fn task_channels(&self) -> &TaskWorkerChannels;
fn disappearing_channels(&self) -> &DisappearingChannels;
fn change_callbacks(&self) -> &UnstableChangeCallbacks;
fn incoming_runtime(&self) -> &IncomingRuntime;
fn identity_resolution_registry(&self) -> &IdentityResolutionRegistry;
fn sync_metrics(&self) -> Option<Arc<WorkerMetrics<SyncMetric>>>;
fn mutexes(&self) -> &MutexRegistry;
fn cancellation_token(&self) -> &CancellationToken;
fn shutdown_complete(&self) -> bool;
fn mark_shutdown_complete(&self);
// Provided methods
fn device_sync_worker_enabled(&self) -> bool { ... }
fn worker_interval(
&self,
kind: WorkerKind,
const_default: Duration,
) -> (Duration, Duration) { ... }
fn mls_provider(&self) -> XmtpOpenMlsProviderRef<'_, Self::MlsStorage> { ... }
fn signature_request(&self) -> Option<SignatureRequest> { ... }
fn inbox_id(&self) -> InboxIdRef<'_> { ... }
fn installation_id(&self) -> InstallationId { ... }
fn close_message_delivery(&self) -> Result<(), StorageError> { ... }
fn is_closed(&self) -> bool { ... }
}Required Associated Types§
type Db: XmtpDb
type ApiClient: XmtpApi
type MlsStorage: XmtpMlsStorageProvider
Sourcetype ContextReference: XmtpSharedContext<Db = Self::Db, ApiClient = Self::ApiClient, MlsStorage = Self::MlsStorage> + 'static
type ContextReference: XmtpSharedContext<Db = Self::Db, ApiClient = Self::ApiClient, MlsStorage = Self::MlsStorage> + 'static
Owned, cloneable handle for background work; it cannot borrow short-lived resources.
Required Methods§
Sourcefn context_ref(&self) -> &Self::ContextReference
fn context_ref(&self) -> &Self::ContextReference
Return the handle to clone when work can outlive this context borrow.
fn db(&self) -> <Self::Db as XmtpDb>::DbQuery
fn api(&self) -> &ApiClientWrapper<Self::ApiClient>
fn scw_verifier(&self) -> Arc<Box<dyn SmartContractSignatureVerifier>> ⓘ
fn device_sync(&self) -> &DeviceSync
fn fork_recovery_opts(&self) -> &ForkRecoveryOpts
fn worker_config(&self) -> &WorkerConfig
fn mls_storage(&self) -> &Self::MlsStorage
fn identity(&self) -> &Identity
fn version_info(&self) -> &VersionInfo
Sourcefn server_configuration(&self) -> &ServerConfigurationHandle
fn server_configuration(&self) -> &ServerConfigurationHandle
The configuration snapshot every consumer in spec 006 section 6.4 reads.
fn worker_events(&self) -> &Sender<SyncWorkerEvent>
fn local_events(&self) -> &Sender<LocalEvents>
Sourcefn delivery_owner(&self) -> &Mutex<Option<DeliveryOwner>>
fn delivery_owner(&self) -> &Mutex<Option<DeliveryOwner>>
This context’s default-consumer token; the database is the ownership authority.
fn task_channels(&self) -> &TaskWorkerChannels
fn disappearing_channels(&self) -> &DisappearingChannels
Sourcefn change_callbacks(&self) -> &UnstableChangeCallbacks
fn change_callbacks(&self) -> &UnstableChangeCallbacks
Unstable: the host’s registered group-change callbacks.
Sourcefn incoming_runtime(&self) -> &IncomingRuntime
fn incoming_runtime(&self) -> &IncomingRuntime
Shared incoming runtime. Its limits and transport are internal client policy.
Sourcefn identity_resolution_registry(&self) -> &IdentityResolutionRegistry
fn identity_resolution_registry(&self) -> &IdentityResolutionRegistry
Coalesces exact identity lookups without treating a newer snapshot as the requested one.
fn sync_metrics(&self) -> Option<Arc<WorkerMetrics<SyncMetric>>>
fn mutexes(&self) -> &MutexRegistry
fn cancellation_token(&self) -> &CancellationToken
Sourcefn shutdown_complete(&self) -> bool
fn shutdown_complete(&self) -> bool
Returns true only after Client::close has fully torn the client
down (workers drained + DB disconnected). Distinct from Self::is_closed
which fires the moment shutdown begins — this guards close’s
idempotency check so a mid-shutdown failure stays retryable.
fn mark_shutdown_complete(&self)
Provided Methods§
fn device_sync_worker_enabled(&self) -> bool
Sourcefn worker_interval(
&self,
kind: WorkerKind,
const_default: Duration,
) -> (Duration, Duration)
fn worker_interval( &self, kind: WorkerKind, const_default: Duration, ) -> (Duration, Duration)
Resolve (base, jitter) for a worker from the configured
WorkerConfig, falling back to the worker’s compiled-in const.
Sourcefn mls_provider(&self) -> XmtpOpenMlsProviderRef<'_, Self::MlsStorage>
fn mls_provider(&self) -> XmtpOpenMlsProviderRef<'_, Self::MlsStorage>
Creates a new MLS Provider
fn signature_request(&self) -> Option<SignatureRequest>
fn inbox_id(&self) -> InboxIdRef<'_>
fn installation_id(&self) -> InstallationId
Sourcefn close_message_delivery(&self) -> Result<(), StorageError>
fn close_message_delivery(&self) -> Result<(), StorageError>
Release this context’s message consumer before disconnecting its database.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
type Db = <T as XmtpSharedContext>::Db
type ApiClient = <T as XmtpSharedContext>::ApiClient
type MlsStorage = <T as XmtpSharedContext>::MlsStorage
type ContextReference = <T as XmtpSharedContext>::ContextReference
fn context_ref(&self) -> &Self::ContextReference
fn db(&self) -> <Self::Db as XmtpDb>::DbQuery
fn api(&self) -> &ApiClientWrapper<Self::ApiClient>
fn scw_verifier(&self) -> Arc<Box<dyn SmartContractSignatureVerifier>> ⓘ
fn device_sync(&self) -> &DeviceSync
fn device_sync_worker_enabled(&self) -> bool
fn fork_recovery_opts(&self) -> &ForkRecoveryOpts
fn worker_config(&self) -> &WorkerConfig
fn mls_storage(&self) -> &Self::MlsStorage
fn identity(&self) -> &Identity
fn version_info(&self) -> &VersionInfo
fn server_configuration(&self) -> &ServerConfigurationHandle
fn worker_events(&self) -> &Sender<SyncWorkerEvent>
fn local_events(&self) -> &Sender<LocalEvents>
fn delivery_owner(&self) -> &Mutex<Option<DeliveryOwner>>
fn task_channels(&self) -> &TaskWorkerChannels
fn disappearing_channels(&self) -> &DisappearingChannels
fn change_callbacks(&self) -> &UnstableChangeCallbacks
fn incoming_runtime(&self) -> &IncomingRuntime
fn identity_resolution_registry(&self) -> &IdentityResolutionRegistry
fn sync_metrics(&self) -> Option<Arc<WorkerMetrics<SyncMetric>>>
fn mutexes(&self) -> &MutexRegistry
fn cancellation_token(&self) -> &CancellationToken
fn shutdown_complete(&self) -> bool
fn mark_shutdown_complete(&self)
Source§fn mls_storage(&self) -> &Self::MlsStorage
fn mls_storage(&self) -> &Self::MlsStorage
a reference to the MLS Storage Type This can be related to ‘db()’ but may also be separate