pub struct ClientBuilder { /* private fields */ }Expand description
Runtime-validated, low-level builder for Client.
Unlike crate::bot::BotBuilder, this builder deliberately does not use
typestate. FFI and embedded hosts can populate dependencies dynamically and
receive a typed error without encoding Rust generic state in their wrapper.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
pub fn with_runtime<R>(self, runtime: R) -> Selfwhere
R: Runtime,
pub fn with_runtime_arc(self, runtime: Arc<dyn Runtime>) -> Self
pub fn with_persistence_manager( self, persistence_manager: Arc<PersistenceManager>, ) -> Self
pub fn with_transport_factory<T>(self, transport_factory: T) -> Selfwhere
T: TransportFactory + 'static,
pub fn with_transport_factory_arc( self, transport_factory: Arc<dyn TransportFactory>, ) -> Self
pub fn with_http_client<H>(self, http_client: H) -> Selfwhere
H: HttpClient + 'static,
pub fn with_http_client_arc(self, http_client: Arc<dyn HttpClient>) -> Self
pub fn with_version_override(self, version: (u32, u32, u32)) -> Self
pub fn with_cache_config(self, cache_config: CacheConfig) -> Self
Sourcepub fn with_enc_handler<H>(
self,
payload_type: impl Into<String>,
handler: H,
) -> Selfwhere
H: EncHandler + 'static,
pub fn with_enc_handler<H>(
self,
payload_type: impl Into<String>,
handler: H,
) -> Selfwhere
H: EncHandler + 'static,
Register a handler for one encrypted payload type before the client starts.
Sourcepub fn with_enc_handler_arc(
self,
payload_type: impl Into<String>,
handler: Arc<dyn EncHandler>,
) -> Self
pub fn with_enc_handler_arc( self, payload_type: impl Into<String>, handler: Arc<dyn EncHandler>, ) -> Self
Register an already-shared encrypted payload handler.
Sourcepub fn with_inbound_durability_hook<H>(self, hook: H) -> Selfwhere
H: InboundDurabilityHook + 'static,
pub fn with_inbound_durability_hook<H>(self, hook: H) -> Selfwhere
H: InboundDurabilityHook + 'static,
Install the durable-inbound hook after verifying backend support.
Sourcepub fn with_inbound_durability_hook_arc(
self,
hook: Arc<dyn InboundDurabilityHook>,
) -> Self
pub fn with_inbound_durability_hook_arc( self, hook: Arc<dyn InboundDurabilityHook>, ) -> Self
Install an already-shared durable-inbound hook.
pub fn with_skip_history_sync(self, skip: bool) -> Self
pub fn with_wanted_pre_key_count(self, count: usize) -> Self
pub fn with_resend_rate_limit(self, burst: u32, refill_per_min: u32) -> Self
Sourcepub fn with_task_instrument(self, instrument: Arc<dyn TaskInstrument>) -> Self
pub fn with_task_instrument(self, instrument: Arc<dyn TaskInstrument>) -> Self
Instrument every task spawned through the configured runtime.
Sourcepub fn with_alloc_meter(self, meter: Arc<AllocMeter>) -> Self
pub fn with_alloc_meter(self, meter: Arc<AllocMeter>) -> Self
Install allocation attribution as the task instrument.
Sourcepub fn with_background_saver_interval(self, interval: Duration) -> Self
pub fn with_background_saver_interval(self, interval: Duration) -> Self
Run periodic device persistence for the lifetime of the client.
Sourcepub fn with_lifecycle<L>(self, lifecycle: L) -> Selfwhere
L: ClientLifecycle + 'static,
Available on crate feature client-lifecycle only.
pub fn with_lifecycle<L>(self, lifecycle: L) -> Selfwhere
L: ClientLifecycle + 'static,
client-lifecycle only.Install the aggregate lifecycle used by extensions of this client.
Sourcepub fn with_lifecycle_arc(self, lifecycle: Arc<dyn ClientLifecycle>) -> Self
Available on crate feature client-lifecycle only.
pub fn with_lifecycle_arc(self, lifecycle: Arc<dyn ClientLifecycle>) -> Self
client-lifecycle only.Install an already-shared aggregate lifecycle.
Sourcepub fn with_plugin<P: ClientPlugin>(self, plugin: P) -> Self
Available on crate feature plugins only.
pub fn with_plugin<P: ClientPlugin>(self, plugin: P) -> Self
plugins only.Register a native plugin for transactional installation before services start.
Sourcepub fn with_plugin_arc<P: ClientPlugin>(self, plugin: Arc<P>) -> Self
Available on crate feature plugins only.
pub fn with_plugin_arc<P: ClientPlugin>(self, plugin: Arc<P>) -> Self
plugins only.Register an already-shared native plugin without changing its marker type.
Sourcepub fn with_untyped_plugin<P: UntypedClientPlugin>(self, plugin: P) -> Self
Available on crate feature plugins only.
pub fn with_untyped_plugin<P: UntypedClientPlugin>(self, plugin: P) -> Self
plugins only.Register a manifest-ID-keyed plugin that exposes no Rust typed API.
Sourcepub fn with_untyped_plugin_arc<P: UntypedClientPlugin + ?Sized>(
self,
plugin: Arc<P>,
) -> Self
Available on crate feature plugins only.
pub fn with_untyped_plugin_arc<P: UntypedClientPlugin + ?Sized>( self, plugin: Arc<P>, ) -> Self
plugins only.Register an already-shared manifest-ID-keyed plugin.
Sourcepub fn with_plugin_host_config(self, config: PluginHostConfig) -> Self
Available on crate feature plugins only.
pub fn with_plugin_host_config(self, config: PluginHostConfig) -> Self
plugins only.Configure plugin lifecycle and tracked-task deadlines.
Sourcepub async fn build(self) -> Result<ClientBuild, ClientBuilderError>
pub async fn build(self) -> Result<ClientBuild, ClientBuilderError>
Validate dependencies, assemble an inert client, then start its services.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ClientBuilder
impl !UnwindSafe for ClientBuilder
impl Freeze for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin for ClientBuilder
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more