Skip to main content

Protocol

Trait Protocol 

Source
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§

Source

const VERSION: &'static str

Source

const NAME: &'static str

Required Associated Types§

Provided Methods§

Source

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".

Implementors§

Source§

impl<T> Protocol for Server<T>
where T: NineP200L + Clone,

Source§

const VERSION: &'static str = "9P2000.L"

Source§

const NAME: &'static str = "9p"

Source§

type Error = Error

Source§

type Request = Tmessage

Source§

type Response = Rmessage