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: 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; the backend recipient expires.

Source

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

Read the locally stored state without a backend call.

Source§

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

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 (CFG-030, CFG-080). 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 (CFG-082).

Applies the same validation (CFG-044), storage (CFG-048), and identifier binding (CFG-051) 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, conn: &impl DbQuery, identifier: Identifier, ) -> Result<Option<String>, ClientError>

Calls the server to look up the inbox_id associated with a given 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

Set a consent record in the local database. If the consent record is an address set the consent state for both the address and inbox_id

Get the consent state for a given entity

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

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>

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

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 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>

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.

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 This is expected to be run any time the client receives new Welcome messages

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>

Check whether an account_identifier has a key package registered on the network

Arguments:

  • account_identifier: a list of account identifiers to check

Returns: A Vec of booleans indicating whether each account address has a key package registered on the network

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>>

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_all_messages_with_callback( context: Context, conversation_type: Option<ConversationType>, consent_state: 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_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>>

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<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either [OwoColorize::fg] or a color-specific method, such as [OwoColorize::green], Read more
§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either [OwoColorize::bg] or a color-specific method, such as [OwoColorize::on_yellow], Read more
§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
§

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,

Source§

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

Source§

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

§

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