Skip to main content

Client

Struct Client 

Source
pub struct Client<Context> {
    pub context: Context,
    pub installation_id: InstallationId,
    /* private fields */
}
Expand description

Clients manage access to the network, identity, and data store

Fields§

§context: Context§installation_id: InstallationId

Implementations§

Source§

impl Client<()>

Source

pub fn builder(strategy: IdentityStrategy) -> ClientBuilder<(), ()>

Get the builder for this Client

Source§

impl<Context> Client<Context>
where Context: XmtpSharedContext,

Source

pub fn identity_updates(&self) -> IdentityUpdates<&Context>

Source

pub fn mls_store(&self) -> MlsStore<Context>

Source

pub fn scw_verifier(&self) -> Arc<Box<dyn SmartContractSignatureVerifier>> ⓘ

Source

pub fn version_info(&self) -> &VersionInfo

Source§

impl<Context> Client<Context>
where Context: XmtpSharedContext, Context::ApiClient: HasStats,

Source§

impl<Context> Client<Context>
where Context: XmtpSharedContext + 'static,

Source

pub fn reconnect_db(&self) -> Result<(), ClientError>

Reconnect to the client’s database if it has previously been released

Source

pub async fn close(&self) -> Result<(), ClientError>

Cleanly shut down this client: cancel in-flight workers and streams, then release the DB connection. Idempotent — a second call is Ok(()).

Callers (notably the Node binding consumers) should await this before deleting the SQLite file or dropping the client wrapper, to avoid late log spew from detached workers/streams firing against a dead DB.

Source

pub async fn wait_for_sync_worker_init(&self)

yields until the sync worker notifies that it is initialized and running.

Source

pub fn sync_metrics(&self) -> Option<Arc<WorkerMetrics<SyncMetric>>>

Source§

impl<Context> Client<Context>
where Context: XmtpSharedContext,

Source

pub fn server_configuration(&self) -> &ServerConfiguration

What this deployment published about itself, as resolved at build. A refresh rewrites the stored copy; it never changes this value.

Source

pub async fn refresh_server_configuration( &self, ) -> Result<ServerConfiguration, ClientError>

Fetch the deployment configuration now and rewrite the stored copy.

Applies the same validation, storage, and identifier binding the refresh worker applies. The snapshot this client is holding is unchanged: a new value takes effect at the next build.

Source

pub fn installation_public_key(&self) -> InstallationId

Retrieves the client’s installation public key, sometimes also called installation_id

Source

pub fn inbox_id(&self) -> InboxIdRef<'_>

Retrieves the client’s inbox ID

Source

pub fn db(&self) -> <Context::Db as XmtpDb>::DbQuery

get a reference to the monolithic Database object where higher-level queries are defined

Source

pub fn device_sync_client(&self) -> DeviceSyncClient<Context>

Source

pub async fn find_inbox_id_from_identifier( &self, identifier: Identifier, ) -> Result<Option<String>, ClientError>

The inbox that holds identifier, or None. The backend’s answer counts only when the newest state the client derives for the answered inbox holds the identifier.

Source

pub fn inbox_sequence_id( &self, conn: &DbConnection<<Context::Db as XmtpDb>::Connection>, ) -> Result<i64, StorageError>

Get the highest sequence_id from the local database for the client’s inbox_id. This may not be consistent with the latest state on the backend.

Source

pub async fn inbox_state( &self, refresh_from_network: bool, ) -> Result<AssociationState, ClientError>

Get the [AssociationState] for the client’s inbox_id

Source

pub async fn inbox_addresses( &self, refresh_from_network: bool, inbox_ids: Vec<InboxIdRef<'_>>, ) -> Result<Vec<AssociationState>, ClientError>

Get the [AssociationState] for each inbox_id

Source

pub async fn fetch_inbox_updates_count( &self, refresh_from_network: bool, inbox_ids: Vec<InboxIdRef<'_>>, ) -> Result<HashMap<InboxId, u32>, ClientError>

Get the total number of inbox updates for inbox_ids. refresh_from_network will force a network refresh. May still access network if an inbox_id does not yet exist in the local cache.

Source

pub async fn fetch_own_inbox_updates_count( &self, refresh_from_network: bool, ) -> Result<u32, ClientError>

Get the total number of inbox updates for the client’s inbox_id. Setting refresh_from_network forces a network refresh, otherwise this operation is offline.

Source

pub async fn inbox_creation_signature_kind( &self, inbox_id: InboxIdRef<'_>, refresh_from_network: bool, ) -> Result<Option<SignatureKind>, ClientError>

Get the signature kind used to create an inbox.

§Arguments
  • inbox_id - The inbox ID to check
  • refresh_from_network - Whether to fetch updates from the network first
§Returns
  • Some(SignatureKind) - The signature kind used to create the inbox
  • None - Inbox doesn’t exist or creation info is unavailable

Store the app’s consent decisions in one transaction. An act on a group id the client does not hold fails the whole call, and nothing is stored.

The consent an app reads for an entity: a conversation’s under its key, held or not, or an inbox’s record.

Source

pub fn release_db_connection(&self) -> Result<(), ClientError>

Release the client’s database connection

Source

pub fn identity(&self) -> &Identity

Get a reference to the client’s identity struct

Source

pub fn create_group( &self, permissions_policy_set: Option<PolicySet>, opts: Option<GroupMetadataOptions>, ) -> Result<MlsGroup<Context>, ClientError>

Create a new group with the default settings Applies a custom PolicySet to the group if one is specified

Source

pub async fn create_group_with_identifiers( &self, account_identifiers: &[Identifier], permissions_policy_set: Option<PolicySet>, opts: Option<GroupMetadataOptions>, ) -> Result<MlsGroup<Context>, ClientError>

Create a group with an initial set of members added. Every account resolves before the group is stored, as do member identities and key packages. An account with no inbox fails with GroupError::AddressNotFound.

Source

pub async fn create_group_with_members( &self, inbox_ids: &[impl AsIdRef], permissions_policy_set: Option<PolicySet>, opts: Option<GroupMetadataOptions>, ) -> Result<MlsGroup<Context>, ClientError>

Returns the stored group if its first add is still pending when the wait ends. A later sync completes the add.

Source

pub async fn find_or_create_dm_by_identity( &self, target_identity: Identifier, opts: Option<DMMetadataOptions>, ) -> Result<MlsGroup<Context>, ClientError>

Find or create a Direct Message with the default settings

Source

pub async fn find_or_create_dm( &self, inbox_id: impl AsIdRef, opts: Option<DMMetadataOptions>, ) -> Result<MlsGroup<Context>, ClientError>

Find or create a Direct Message by inbox_id with the default settings. A stored DM whose creation stopped before the peer was added gets the peer first, and any failure of that add is returned, as a new DM’s creation returns its add’s failure.

Source

pub fn group( &self, group_id: &GroupId, ) -> Result<MlsGroup<Context>, ClientError>

Look up a group by its ID

Returns a MlsGroup if the group exists, or an error if it does not

Source

pub fn stitched_group( &self, group_id: &GroupId, ) -> Result<MlsGroup<Context>, ClientError>

Look up a group by its ID while stitching DMs

Returns a MlsGroup if the group exists, or an error if it does not

Source

pub fn find_duplicate_dms_for_group( &self, group_id: &GroupId, ) -> Result<Vec<MlsGroup<Context>>, ClientError>

Find all the duplicate dms for this group

Source

pub fn group_disappearing_settings( &self, group_id: &GroupId, ) -> Result<Option<MessageDisappearingSettings>, ClientError>

Fetches the message disappearing settings for a given group ID.

Returns Some(MessageDisappearingSettings) if the group exists and has valid settings, None if the group or settings are missing, or Err(ClientError) on a database error.

Source

pub fn dm_group_from_target_inbox( &self, target_inbox_id: String, ) -> Result<MlsGroup<Context>, ClientError>

Look up a DM group by the target’s inbox_id.

Returns a MlsGroup if the group exists, or an error if it does not

Source

pub fn message( &self, message_id: Vec<u8>, ) -> Result<StoredGroupMessage, ClientError>

Look up a message by its ID Returns a [StoredGroupMessage] if the message exists, or an error if it does not

Source

pub async fn message_with_group( &self, id: &[u8], ) -> Result<Option<(StoredGroupMessage, MlsGroup<Context>)>, ClientError>

Look up a stored message and its current conversation. A message in a duplicate DM resolves to the stitched conversation.

Source

pub fn message_v2( &self, message_id: Vec<u8>, ) -> Result<DecodedMessage, ClientError>

Look up and enrich a message by its ID, returning a [DecodedMessage] Returns an error if the message is not found or if it cannot be decoded/enriched

Source

pub fn delete_message(&self, message_id: Vec<u8>) -> Result<usize, ClientError>

Delete a message by its ID This method is idempotent and will not error if the message is not found Returns the number of messages deleted (0 or 1)

Source

pub fn find_groups( &self, args: GroupQueryArgs, ) -> Result<Vec<MlsGroup<Context>>, ClientError>

Query for groups with optional filters

Filters:

  • allowed_states: only return groups with the given membership states
  • created_after_ns: only return groups created after the given timestamp (in nanoseconds)
  • created_before_ns: only return groups created before the given timestamp (in nanoseconds)
  • limit: only return the first limit groups
Source

pub fn list_conversations( &self, args: GroupQueryArgs, ) -> Result<Vec<ConversationListItem<Context>>, ClientError>

List one page of the app’s conversations, in activity order unless args names another order. A page holds at most args.limit conversations, or CONVERSATION_LIST_DEFAULT_LIMIT when it names none. To read the next page, pass the last row’s listing_time_ns as the order’s before time and its group id as before_id.

Internal callers that need every group use find_groups or fetch_conversation_list, which apply no default limit.

Source

pub async fn register_with_owner( &self, owner: &impl InboxOwner, ) -> Result<(), ClientError>

Register this installation with an inbox owner and wait until it is visible.

Source

pub async fn register_identity( &self, signature_request: SignatureRequest, ) -> Result<(), ClientError>

Upload the key package before the identity update exposes this installation. Record its receipt for key retirement and retain the registration cursor. Return success only after the backend can read the registration receipt.

Source

pub fn is_registration_visible(&self) -> Result<bool, ClientError>

Whether registration has completed its visibility confirmation. A stored identity with a pending receipt is not yet registered.

Source

pub async fn ensure_registration_visible(&self) -> Result<(), ClientError>

Confirm a stored registration before reporting success.

Source

pub async fn wait_for_registration_visible( &self, options: VisibilityConfirmationOptions, ) -> Result<(), ClientError>

Wait until the serving database exposes the registration identity-topic head. A missing or older head is polled. The timeout also bounds each request.

Source

pub fn queue_key_rotation(&self) -> Result<(), ClientError>

If no key rotation is scheduled, queue it to occur in the next 5 seconds.

Source

pub async fn rotate_and_upload_key_package(&self) -> Result<(), ClientError>

Upload a new key package to the network replacing an existing key package.

Source

pub async fn get_key_packages_for_installation_ids( &self, installation_ids: Vec<Vec<u8>>, ) -> Result<HashMap<Vec<u8>, Result<VerifiedKeyPackageV2, KeyPackageVerificationError>>, ClientError>

Fetches the current key package from the network for each of the installation_ids specified

Source

pub async fn sync_welcomes(&self) -> Result<Vec<MlsGroup<Context>>, GroupError>

Download all unread welcome messages and converts to a group struct, ignoring malformed messages. Returns any new groups created in the operation

Source

pub async fn sync_all_groups( &self, groups: Vec<MlsGroup<Context>>, ) -> Result<GroupSyncSummary, GroupError>

Sync all groups for the current installation and return the number of groups that were synced. Only active groups will be synced.

Source

pub async fn sync_all_welcomes_and_groups( &self, consent_states: Option<Vec<ConsentState>>, ) -> Result<GroupSyncSummary, GroupError>

Sync all unread welcome messages and then sync all groups. Returns the total number of active groups synced.

Source

pub async fn unstick_paused_groups(&self) -> Result<usize, GroupError>

Sweep every group flagged paused_for_version and clear the pause flag for any whose floor is now satisfied by this client’s pkg_version. Pure local-state operation — no network calls. Returns the count of groups unstuck.

sync_all_welcomes_and_groups already runs this sweep as a preamble; the standalone entry point is for SDKs that want a cheap “post-upgrade recovery” hook independent of the normal sync flow.

Source

pub async fn sync_all_welcomes_and_device_sync_groups( &self, ) -> Result<GroupSyncSummary, ClientError>

Source

pub async fn sync_all_device_sync_groups( &self, ) -> Result<GroupSyncSummary, ClientError>

Source

pub async fn validate_credential_against_network( &self, conn: &DbConnection<<Context::Db as XmtpDb>::Connection>, credential: &[u8], installation_pub_key: Vec<u8>, ) -> Result<InboxId, ClientError>

Validates a credential against the given installation public key

This will go to the network and get the latest association state for the inbox. It ensures that the installation_pub_key is in that association state

Source

pub async fn can_message( &self, account_identifiers: &[Identifier], ) -> Result<HashMap<Identifier, bool>, ClientError>

Reports whether the backend names an inbox for each identifier. This is an unverified availability hint. The client does not independently verify the lookup against current association state or check key packages. This is not a delivery guarantee.

Arguments:

  • account_identifier: a list of account identifiers to check

Returns: A map from each identifier to its availability hint.

Source§

impl<Context: XmtpSharedContext> Client<Context>

Source

pub fn attachments(&self) -> Attachments<Context>

Source§

impl<Context: XmtpSharedContext> Client<Context>

Source

pub async fn enable_notifications( &self, config: NotificationConfig, ) -> Result<NotificationState, NotificationError>

Store configuration, then register inline. The task retries transient errors.

Source

pub async fn disable_notifications(&self) -> Result<(), NotificationError>

Disable locally before unregistering. The recipient identity and overrides stay. A failed unregister leaves the client disabled with its recipient reset owed.

Source

pub fn notification_state(&self) -> Result<NotificationState, StorageError>

Read the locally stored state without a backend call.

Source§

impl<Context: XmtpSharedContext> Client<Context>

Source

pub async fn resolve_handles( &self, handles: &[Handle], ) -> Result<Vec<Option<InboxId>>, ClientError>

The inbox that holds each handle, in order, or None. An answer from the backend counts only when the newest state the client derives for the answered inbox holds the handle. An old handle of an inbox still resolves to it.

Source

pub async fn handles_have_owner( &self, handles: &[Handle], ) -> Result<Vec<bool>, ClientError>

Whether the backend names an inbox for each handle, in order. This checks no association state: use it only where a wrong answer costs a candidate, never to reach an inbox.

Source

pub async fn available_handles( &self, input: &str, ) -> Result<Vec<Handle>, ClientError>

The handles for input that no inbox holds. input is a handle as a user typed it; its ASCII capitals become lowercase. Input with a code checks only that handle. A name without a code checks the name and HANDLE_SEARCH_CODES distinct random codes in one lookup, and the name comes first in the result. Text outside the handle grammar fails before any request. No policy applies here, so a returned handle can still be refused when it is claimed.

Source

pub async fn claim_handle(&self, handle: &Handle) -> Result<(), ClientError>

Claim handle for this client’s inbox, signed by this installation’s key. A claim of a handle the inbox already holds makes it the display handle again. The backend refuses a taken, reserved, short, or too frequent claim with ApiError::HandleRejected. After the publish, the client has stored the inbox’s new identity update.

Source

pub async fn resolve_targets( &self, targets: &[IdentityTarget], ) -> Result<Vec<InboxId>, ClientError>

The inbox of each target, in order, from one call. Fails when any target has no inbox: an account as find_or_create_dm_by_identity does, and a handle with HandleError::NotFound.

Source

pub async fn find_dm_by_target( &self, target: &IdentityTarget, ) -> Result<Option<MlsGroup<Context>>, ClientError>

The active DM with target, or None. A target that no inbox holds has no DM.

Source

pub async fn find_or_create_dm_by_target( &self, target: &IdentityTarget, opts: DMMetadataOptions, ) -> Result<MlsGroup<Context>, ClientError>

Find the DM with target, or create it. A handle resolves before the existing DM is looked up.

Source

pub async fn create_group_with_targets( &self, targets: &[IdentityTarget], permissions_policy_set: Option<PolicySet>, opts: Option<GroupMetadataOptions>, ) -> Result<MlsGroup<Context>, ClientError>

Create a group with targets as its members, in one commit. Targets, member identities, and key packages resolve before the group is stored. A target with no inbox leaves no group: a handle fails with HandleError::NotFound, an account with GroupError::AddressNotFound.

Source§

impl<Context> Client<Context>
where Context: XmtpSharedContext + 'static,

Source

pub async fn process_streamed_welcome_message( &self, envelope_bytes: Vec<u8>, ) -> Result<Vec<MlsGroup<Context>>, SubscribeError>

Use push metadata as a target. Fetch its complete prefix before processing.

Source

pub async fn stream_conversations( &self, conversation_type: Option<ConversationType>, include_duplicate_dms: bool, ) -> Result<impl Stream<Item = Result<MlsGroup<Context>, SubscribeError>> + use<'_, Context>, SubscribeError>
where Context::ApiClient: XmtpMlsStreams,

Source

pub async fn stream_conversations_owned( &self, conversation_type: Option<ConversationType>, include_duplicate_dms: bool, ) -> Result<impl Stream<Item = Result<MlsGroup<Context>, SubscribeError>> + 'static + use<Context>, SubscribeError>
where Context::ApiClient: XmtpMlsStreams,

Stream conversations but decouple the lifetime of ‘self’ from the stream.

Source§

impl<Context> Client<Context>
where Context: XmtpSharedContext + 'static, Context::ApiClient: XmtpMlsStreams + 'static, Context::MlsStorage: 'static,

Source

pub fn stream_conversations_with_callback( client: Arc<Client<Context>>, conversation_type: Option<ConversationType>, convo_callback: impl FnMut(Result<MlsGroup<Context>, SubscribeError>) + MaybeSend + 'static, on_close: impl FnOnce() + MaybeSend + 'static, include_duplicate_dms: bool, ) -> impl StreamHandle<StreamOutput = Result<(), SubscribeError>>

Source

pub async fn stream_all_messages( &self, conversation_type: Option<ConversationType>, consent_state: Option<Vec<ConsentState>>, ) -> Result<impl Stream<Item = Result<StoredGroupMessage, SubscribeError>> + '_, SubscribeError>

Source

pub async fn stream_all_messages_owned( &self, conversation_type: Option<ConversationType>, consent_state: Option<Vec<ConsentState>>, ) -> Result<impl Stream<Item = Result<StoredGroupMessage, SubscribeError>> + 'static + use<Context>, SubscribeError>

Source

pub fn stream_preferences_with_callback( client: Arc<Client<Context>>, callback: impl FnMut(Result<Vec<PreferenceUpdate>, SubscribeError>) + MaybeSend + 'static, on_close: impl FnOnce() + MaybeSend + 'static, ) -> impl StreamHandle<StreamOutput = Result<(), SubscribeError>>

Source

pub fn stream_message_deletions_with_callback( client: Arc<Client<Context>>, callback: impl FnMut(Result<DecodedMessage, SubscribeError>) + MaybeSend + 'static, on_close: impl FnOnce() + MaybeSend + 'static, ) -> impl StreamHandle<StreamOutput = Result<(), SubscribeError>>

Source§

impl<C: XmtpSharedContext + 'static> Client<C>

Source

pub async fn catch_up_to_live( &self, timeout: Option<Duration>, ) -> Result<CatchUpSummary, CatchUpError>

Process fixed starting targets and only the discoveries from the enrolled Welcomes.

Source§

impl<C> Client<C>

Source

pub fn stream_all_messages_with_callback_dispatch( client: Arc<Client<C>>, conversation_type: Option<ConversationType>, consent_states: Option<Vec<ConsentState>>, callback: impl FnMut(Result<StoredGroupMessage, SubscribeError>) + MaybeSend + 'static, on_close: impl FnOnce() + MaybeSend + 'static, ) -> impl StreamHandle<StreamOutput = Result<(), SubscribeError>>

Source

pub fn stream_conversations_with_callback_dispatch( client: Arc<Client<C>>, conversation_type: Option<ConversationType>, include_duplicate_dms: bool, callback: impl FnMut(Result<MlsGroup<C>, SubscribeError>) + MaybeSend + 'static, on_close: impl FnOnce() + MaybeSend + 'static, ) -> impl StreamHandle<StreamOutput = Result<(), SubscribeError>>

Trait Implementations§

Source§

impl<Context: Clone> Clone for Client<Context>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Context> Drop for Client<Context>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<Context> Freeze for Client<Context>
where Context: Freeze,

§

impl<Context> !RefUnwindSafe for Client<Context>

§

impl<Context> Send for Client<Context>
where Context: Send,

§

impl<Context> Sync for Client<Context>
where Context: Sync,

§

impl<Context> Unpin for Client<Context>
where Context: Unpin,

§

impl<Context> UnsafeUnpin for Client<Context>
where Context: UnsafeUnpin,

§

impl<Context> !UnwindSafe for Client<Context>

Blanket Implementations§

§

impl<T> AggregateExpressionMethods for T

§

fn aggregate_distinct(self) -> Self::Output
where Self: DistinctDsl,

DISTINCT modifier for aggregate functions Read more
§

fn aggregate_all(self) -> Self::Output
where Self: AllDsl,

ALL modifier for aggregate functions Read more
§

fn aggregate_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add an aggregate function filter Read more
§

fn aggregate_order<O>(self, o: O) -> Self::Output
where Self: OrderAggregateDsl<O>,

Add an aggregate function order Read more
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Converts &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSend for T
where T: Any + Send,

§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

impl<T> Identity for T
where T: ?Sized,

§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<T> IntoSql for T

§

fn into_sql<T>(self) -> Self::Expression
where Self: Sized + AsExpression<T>, T: SqlType + TypedExpressionType,

Convert self to an expression for Diesel’s query builder. Read more
§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WindowExpressionMethods for T

§

fn over(self) -> Self::Output
where Self: OverDsl,

Turn a function call into a window function call Read more
§

fn window_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add a filter to the current window function Read more
§

fn partition_by<E>(self, expr: E) -> Self::Output
where Self: PartitionByDsl<E>,

Add a partition clause to the current window function Read more
§

fn window_order<E>(self, expr: E) -> Self::Output
where Self: OrderWindowDsl<E>,

Add a order clause to the current window function Read more
§

fn frame_by<E>(self, expr: E) -> Self::Output
where Self: FrameDsl<E>,

Add a frame clause to the current window function Read more
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> MaybeSend for T
where T: Send + ?Sized,

§

impl<T> MaybeSync for T
where T: Sync + ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,