pub trait BidiBinding: Send + 'static {
type Request: Send + 'static;
type Response: Send + 'static;
type Mutate: Send;
type GroupMessage: MaybeSend + MaybeSync;
type WelcomeMessage: MaybeSend + MaybeSync;
// Required methods
fn mutate_frame(mutate: Self::Mutate) -> Self::Request;
fn ping_frame(nonce: u64) -> Self::Request;
fn pong_frame(nonce: u64) -> Self::Request;
fn handle(
response: Self::Response,
) -> Inbound<Self::GroupMessage, Self::WelcomeMessage>;
}Expand description
Backend-specific wire vocabulary for a bidi subscription. The control core is
generic over this: a binding names the wire request/response types and the
per-backend Mutate and message types, builds outbound frames, and — via
BidiBinding::handle — classifies an inbound response into an Inbound
instruction.
Required Associated Types§
Sourcetype GroupMessage: MaybeSend + MaybeSync
type GroupMessage: MaybeSend + MaybeSync
Encrypted group envelope for the consumer.
Sourcetype WelcomeMessage: MaybeSend + MaybeSync
type WelcomeMessage: MaybeSend + MaybeSync
Encrypted welcome envelope for the consumer.
Required Methods§
Sourcefn mutate_frame(mutate: Self::Mutate) -> Self::Request
fn mutate_frame(mutate: Self::Mutate) -> Self::Request
Wrap a Mutate as an outbound request frame.
Sourcefn ping_frame(nonce: u64) -> Self::Request
fn ping_frame(nonce: u64) -> Self::Request
A client Ping request frame (liveness probe).
Sourcefn pong_frame(nonce: u64) -> Self::Request
fn pong_frame(nonce: u64) -> Self::Request
A Pong request frame answering a server Ping.
Sourcefn handle(
response: Self::Response,
) -> Inbound<Self::GroupMessage, Self::WelcomeMessage>
fn handle( response: Self::Response, ) -> Inbound<Self::GroupMessage, Self::WelcomeMessage>
Classify one inbound response into an actor instruction. An associated fn, like the frame constructors: bindings are stateless by design — any stateful ordering or cursor tracking belongs to the consumer, not a single connection actor.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.