pub trait Protocol:
Sized
+ Send
+ Sync
+ Send
+ Sync {
type Request: Framer;
type Response: Framer;
type Error: IntoError;
const VERSION: &'static str;
const NAME: &'static str;
// Provided method
fn tcancel(_oldtag: u16, _binding: u64) -> Option<Self::Request> { ... }
}Expand description
Defines the request and response types for the JetStream protocol.
Required Associated Constants§
Required Associated Types§
Provided Methods§
Sourcefn tcancel(_oldtag: u16, _binding: u64) -> Option<Self::Request>
fn tcancel(_oldtag: u16, _binding: u64) -> Option<Self::Request>
r[impl jetstream.subscription.cancel] The cancellation request for a subscription on this lane, if this protocol has subscriptions to cancel.
The client needs to build a request it cannot name: Mux is
generic over the protocol, and subscription::Tcancel is a
payload, not a Request. Only the protocol knows how one is
carried in its own request type, so it says here.
r[impl jetstream.subscription.compat.rpc-layer]
Defaulted to None — a protocol with no streaming methods has
nothing to cancel, and every protocol written before this existed
compiles untouched.
binding is zero on the subscription’s own lane, where oldtag
is unambiguous; see subscription::Tcancel.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".