pub struct ServerConfigurationHandle {
pub admission: Arc<Mutex<()>>,
pub pending: Arc<Atomic<bool>>,
pub fetch: Arc<OnceLock<Arc<dyn ConfigurationFetch>>>,
/* private fields */
}Expand description
The snapshot the client was built with, plus a blocked connection a refresh may set.
Cloning shares both: every consumer sees the blocked connection when a refresh sets it.
Fields§
§admission: Arc<Mutex<()>>Serializes the first-request configuration check and explicit refreshes, so one fetch runs at a time.
pending: Arc<Atomic<bool>>Set while the first-request configuration check has not committed.
fetch: Arc<OnceLock<Arc<dyn ConfigurationFetch>>>The request adapter’s configuration fetch, once the client binds it.
Implementations§
Source§impl ServerConfigurationHandle
impl ServerConfigurationHandle
Sourcepub fn requires_preflight(&self) -> bool
pub fn requires_preflight(&self) -> bool
Whether the first-request configuration check is still pending.
Sourcepub fn new(provider: Arc<dyn ConfigProvider>) -> ServerConfigurationHandle
pub fn new(provider: Arc<dyn ConfigProvider>) -> ServerConfigurationHandle
Hold one snapshot, with no zero left in its limits or attachment upload ceiling.
Wire conversion replaces a zero on the wire with the compiled default, but a
snapshot an app builds in Rust and hands in through a ConfigProvider
never passes through that conversion, and a zero dimension
would panic the chunks(limit) calls in xmtp_api. Every
snapshot reaches a client through this constructor, so sanitizing here
keeps zero limits out of all three readers at once: this handle, the
wrapper that chunks with them, and the transport. It also removes an
unusable attachment offer from a provider snapshot.
Sourcepub fn with_chain_restriction(
self,
custom_verifier: bool,
) -> ServerConfigurationHandle
pub fn with_chain_restriction( self, custom_verifier: bool, ) -> ServerConfigurationHandle
Restrict app-supplied smart contract wallet signatures to the chains the snapshot names. Skipped entirely when the app supplied its own verifier, which the chain restriction exempts.
Sourcepub fn restrict(&self, request: &mut SignatureRequest)
pub fn restrict(&self, request: &mut SignatureRequest)
Bind a signature request to the chains this deployment accepts, before it is handed to the app.
Sourcepub fn configuration(&self) -> &ServerConfiguration
pub fn configuration(&self) -> &ServerConfiguration
The snapshot. Fixed for the life of the client: a refresh rewrites the stored row, never this value.
Sourcepub fn commit_log_enabled(&self) -> bool
pub fn commit_log_enabled(&self) -> bool
Whether this deployment keeps a commit log. Read at every write and read site, so a deployment that turns it off turns it off for every group this client touches.
Sourcepub fn blocked_connection(&self) -> Option<BlockedConnection>
pub fn blocked_connection(&self) -> Option<BlockedConnection>
The blocked connection, if one has been observed.
Sourcepub fn set_event_writer(&self, writer: Arc<dyn EventWriter>)
pub fn set_event_writer(&self, writer: Arc<dyn EventWriter>)
Where a blocked connection reports its client event.
Sourcepub fn set_deployment_recorder(&self, recorder: DeploymentRecorder)
pub fn set_deployment_recorder(&self, recorder: DeploymentRecorder)
The record that a fetched deployment identifier is written to.
Sourcepub async fn record_deployment(
&self,
identifier: &str,
) -> Result<(), ServerConfigError>
pub async fn record_deployment( &self, identifier: &str, ) -> Result<(), ServerConfigError>
Record identifier for this client’s backend URL, when a recorder is set.
Sourcepub fn check(&self) -> Result<(), BlockedConnection>
pub fn check(&self) -> Result<(), BlockedConnection>
Fail when the connection is blocked. Every call that reaches the network goes through here.
Sourcepub fn blocked_or<E>(&self, error: E) -> Ewhere
E: From<BlockedConnection>,
pub fn blocked_or<E>(&self, error: E) -> Ewhere
E: From<BlockedConnection>,
Replace a failure with the blocked connection’s error when a block is recorded. A block during an operation, such as the deferred first request check, cancels the client’s streams, so the stopped work would otherwise report a close or an incomplete barrier instead of why.
Sourcepub fn block_connection(&self, reason: BlockedConnection) -> BlockedConnection
pub fn block_connection(&self, reason: BlockedConnection) -> BlockedConnection
Block the connection on the first failure. A later one does not displace it: the first cause is the one worth reporting.
Trait Implementations§
Source§impl Clone for ServerConfigurationHandle
impl Clone for ServerConfigurationHandle
Source§fn clone(&self) -> ServerConfigurationHandle
fn clone(&self) -> ServerConfigurationHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerConfigurationHandle
impl Debug for ServerConfigurationHandle
Source§impl Default for ServerConfigurationHandle
impl Default for ServerConfigurationHandle
Source§fn default() -> ServerConfigurationHandle
fn default() -> ServerConfigurationHandle
Auto Trait Implementations§
impl Freeze for ServerConfigurationHandle
impl !RefUnwindSafe for ServerConfigurationHandle
impl Send for ServerConfigurationHandle
impl Sync for ServerConfigurationHandle
impl Unpin for ServerConfigurationHandle
impl UnsafeUnpin for ServerConfigurationHandle
impl !UnwindSafe for ServerConfigurationHandle
Blanket Implementations§
§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read more§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read more§fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
fn aggregate_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
§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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<T> IntoSql for T
impl<T> IntoSql for T
§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].