pub struct GuardedApi<A> { /* private fields */ }Expand description
Backend dispatch with a clone-shared client admission hook. The raw transport is private so a caller cannot skip admission through this value.
Implementations§
Source§impl<A> GuardedApi<A>
impl<A> GuardedApi<A>
Sourcepub fn require_preflight(&self)
pub fn require_preflight(&self)
Mark the construction interval fail-closed until the client hook binds.
Source§impl<A: XmtpBackendClient> GuardedApi<A>
impl<A: XmtpBackendClient> GuardedApi<A>
Sourcepub fn bind_preflight(
&self,
make: impl FnOnce(Arc<dyn ConfigurationFetch>) -> Arc<dyn RequestPreflight>,
) -> boolwhere
A: 'static,
pub fn bind_preflight(
&self,
make: impl FnOnce(Arc<dyn ConfigurationFetch>) -> Arc<dyn RequestPreflight>,
) -> boolwhere
A: 'static,
Install the client hook with its restricted configuration capability.
pub async fn check_preflight(&self) -> Result<()>
Trait Implementations§
Source§impl<A> Clone for GuardedApi<A>
impl<A> Clone for GuardedApi<A>
Source§impl<A: Debug> Debug for GuardedApi<A>
impl<A: Debug> Debug for GuardedApi<A>
Source§impl<A: HasStats> HasStats for GuardedApi<A>
impl<A: HasStats> HasStats for GuardedApi<A>
fn aggregate_stats(&self) -> AggregateStats
fn mls_stats(&self) -> ApiStats
fn identity_stats(&self) -> IdentityStats
Source§impl<A: IsConnectedCheck> IsConnectedCheck for GuardedApi<A>
impl<A: IsConnectedCheck> IsConnectedCheck for GuardedApi<A>
Source§impl<A: XmtpBackendClient> XmtpBackendClient for GuardedApi<A>
impl<A: XmtpBackendClient> XmtpBackendClient for GuardedApi<A>
type Error = ApiError
fn publish<'life0, 'async_trait>(
&'life0 self,
request: PublishRequest,
) -> Pin<Box<dyn Future<Output = Result<PublishResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_upload<'life0, 'async_trait>(
&'life0 self,
request: CreateUploadRequest,
) -> Pin<Box<dyn Future<Output = Result<CreateUploadResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query<'life0, 'async_trait>(
&'life0 self,
request: QueryRequest,
) -> Pin<Box<dyn Future<Output = Result<QueryResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn query_newest<'life0, 'async_trait>(
&'life0 self,
request: QueryNewestRequest,
) -> Pin<Box<dyn Future<Output = Result<QueryNewestResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_inbox_ids<'life0, 'async_trait>(
&'life0 self,
request: GetInboxIdsRequest,
) -> Pin<Box<dyn Future<Output = Result<GetInboxIdsResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn get_configuration<'life0, 'async_trait>(
&'life0 self,
request: GetConfigurationRequest,
) -> Pin<Box<dyn Future<Output = Result<GetConfigurationResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_configuration<'life0, 'async_trait>(
&'life0 self,
request: GetConfigurationRequest,
) -> Pin<Box<dyn Future<Output = Result<GetConfigurationResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Read what this deployment publishes about itself. Served without a
credential, so it is the one call a client can make before it knows
whether the deployment requires one.
fn verify_smart_contract_wallet_signatures<'life0, 'async_trait>(
&'life0 self,
request: VerifySmartContractWalletSignaturesRequest,
) -> Pin<Box<dyn Future<Output = Result<VerifySmartContractWalletSignaturesResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register<'life0, 'async_trait>(
&'life0 self,
request: RegisterRequest,
) -> Pin<Box<dyn Future<Output = Result<RecipientState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unregister<'life0, 'async_trait>(
&'life0 self,
request: UnregisterRequest,
) -> Pin<Box<dyn Future<Output = Result<UnregisterResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_subscriptions<'life0, 'async_trait>(
&'life0 self,
request: UpdateSubscriptionsRequest,
) -> Pin<Box<dyn Future<Output = Result<RecipientState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn backend_url(&self) -> Option<&str>
fn backend_url(&self) -> Option<&str>
The backend URL this client sends to, when the transport knows it. Read more
Source§fn has_credential_source(&self) -> bool
fn has_credential_source(&self) -> bool
Whether a credential source — an auth callback or an auth handle — was
configured on this transport. A transport with no auth
middleware reports
false and build refuses a deployment that
requires authentication. Defaults to true so a test double, which has
no transport stack to ask, is never the thing that refuses a build.Source§fn set_limits(&self, limits: Arc<LimitsConfiguration>)
fn set_limits(&self, limits: Arc<LimitsConfiguration>)
Install the shapes the deployment publishes, so the stream and
metadata chunking that happens below
ApiClientWrapper uses them too.
Called once, by build, before any stream opens. A transport with
nothing to chunk ignores it.Source§fn register_client_event_writer(&self, writer: &Arc<dyn EventWriter<()>>)
fn register_client_event_writer(&self, writer: &Arc<dyn EventWriter<()>>)
Register this client’s public event writer with a shared credential.
fn unregister_client_event_writer(&self, writer: &Arc<dyn EventWriter<()>>)
Source§impl<A> XmtpMlsBidiStreams for GuardedApi<A>where
A: XmtpMlsBidiStreams + XmtpBackendClient,
A::SubscribeStream: 'static,
impl<A> XmtpMlsBidiStreams for GuardedApi<A>where
A: XmtpMlsBidiStreams + XmtpBackendClient,
A::SubscribeStream: 'static,
type Error = ApiError
type SubscribeStream = Pin<Box<dyn Stream<Item = Result<SubscribeResponse, ApiError>> + Send>>
Source§fn host(&self) -> &str
fn host(&self) -> &str
Return the URL used for bidi connections. Combine it with the API
client’s Arc identity when selecting a shared connection.
Source§fn bidi_limits(&self) -> Arc<LimitsConfiguration> ⓘ
fn bidi_limits(&self) -> Arc<LimitsConfiguration> ⓘ
The frame shapes this deployment accepts, as installed by
[
XmtpBackendClient::set_limits]. The bidi ledger chunks interest
updates below ApiClientWrapper, so it cannot read the wrapper’s
copy and asks the transport instead. A transport that was never told
reports the compiled defaults.Source§fn subscribe_bidi<'life0, 'async_trait>(
&'life0 self,
requests: BoxStream<'static, SubscribeRequest>,
) -> Pin<Box<dyn Future<Output = Result<Self::SubscribeStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn subscribe_bidi<'life0, 'async_trait>(
&'life0 self,
requests: BoxStream<'static, SubscribeRequest>,
) -> Pin<Box<dyn Future<Output = Result<Self::SubscribeStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Open the bidirectional stream.
requests is the outbound
client→server frame stream (typically fed by a channel; the first
frame is an Update naming the initial topic set); the
returned stream yields the server→client frames.Source§impl<A> XmtpMlsStreams for GuardedApi<A>where
A: XmtpMlsStreams + XmtpBackendClient,
A::GroupMessageStream: 'static,
A::WelcomeMessageStream: 'static,
impl<A> XmtpMlsStreams for GuardedApi<A>where
A: XmtpMlsStreams + XmtpBackendClient,
A::GroupMessageStream: 'static,
A::WelcomeMessageStream: 'static,
type Error = ApiError
type GroupMessageStream = Pin<Box<dyn Stream<Item = Result<GroupMessage, ApiError>> + Send>>
type WelcomeMessageStream = Pin<Box<dyn Stream<Item = Result<WelcomeMessage, ApiError>> + Send>>
Source§fn subscribe_envelopes_with_cursors<'life0, 'life1, 'async_trait>(
&'life0 self,
cursors: &'life1 TopicCursor,
limits: IncomingBatchLimits,
) -> Pin<Box<dyn Future<Output = Result<IncomingSubscription<ApiError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn subscribe_envelopes_with_cursors<'life0, 'life1, 'async_trait>(
&'life0 self,
cursors: &'life1 TopicCursor,
limits: IncomingBatchLimits,
) -> Pin<Box<dyn Future<Output = Result<IncomingSubscription<ApiError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Subscribe after committed receipt positions without decoding MLS payloads.
Acknowledge new positions only after the raw envelopes commit to storage.
fn subscribe_group_messages<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
group_ids: &'life1 [&'life2 GroupId],
) -> Pin<Box<dyn Future<Output = Result<Self::GroupMessageStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn subscribe_group_messages_with_cursors<'life0, 'life1, 'async_trait>(
&'life0 self,
cursors: &'life1 TopicCursor,
) -> Pin<Box<dyn Future<Output = Result<Self::GroupMessageStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn subscribe_welcome_messages<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
installations: &'life1 [&'life2 InstallationId],
) -> Pin<Box<dyn Future<Output = Result<Self::WelcomeMessageStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn subscribe_welcome_messages_with_cursors<'life0, 'life1, 'async_trait>(
&'life0 self,
cursors: &'life1 TopicCursor,
) -> Pin<Box<dyn Future<Output = Result<Self::WelcomeMessageStream>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl<A> Freeze for GuardedApi<A>
impl<A> !RefUnwindSafe for GuardedApi<A>
impl<A> Send for GuardedApi<A>
impl<A> Sync for GuardedApi<A>
impl<A> Unpin for GuardedApi<A>
impl<A> UnsafeUnpin for GuardedApi<A>
impl<A> !UnwindSafe for GuardedApi<A>
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>,
Add an aggregate function filter Read more
§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
Add an aggregate function order Read more
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
Mutably borrows from an owned value. Read more
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>
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>
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)
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)
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
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>
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 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>
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
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
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>,
Applies the layer to a service and wraps it in [
Layered].§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<S, T> Upcast<T> for S
impl<S, T> Upcast<T> for S
§impl<T> WindowExpressionMethods for T
impl<T> WindowExpressionMethods for T
§fn over(self) -> Self::Outputwhere
Self: OverDsl,
fn over(self) -> Self::Outputwhere
Self: OverDsl,
Turn a function call into a window function call Read more
§fn window_filter<P>(self, f: P) -> Self::Outputwhere
P: AsExpression<Bool>,
Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,
fn window_filter<P>(self, f: P) -> Self::Outputwhere
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::Outputwhere
Self: PartitionByDsl<E>,
fn partition_by<E>(self, expr: E) -> Self::Outputwhere
Self: PartitionByDsl<E>,
Add a partition clause to the current window function Read more
§fn window_order<E>(self, expr: E) -> Self::Outputwhere
Self: OrderWindowDsl<E>,
fn window_order<E>(self, expr: E) -> Self::Outputwhere
Self: OrderWindowDsl<E>,
Add a order clause to the current window function Read more