Skip to main content

Protocol

Trait Protocol 

Source
pub trait Protocol:
    Send
    + Sync
    + 'static {
    type Ready: Send + Sync + 'static;

    const REUSE_IDS: bool = true;

    // Required methods
    fn establish(
        stream: BoxTransport,
        options: ConnectOptions,
    ) -> BoxFuture<'static, ClientResult<Established<Self::Ready>>>;
    fn prepare(
        ready: &Self::Ready,
        wire_name: &str,
    ) -> ClientResult<SendMetadata>;
}
Expand description

Protocol-specific setup and message metadata, leaving routing to Client.

Provided Associated Constants§

Source

const REUSE_IDS: bool = true

Whether terminal completion permits reusing a correlation ID.

Required Associated Types§

Source

type Ready: Send + Sync + 'static

Shared immutable metadata negotiated during setup.

Required Methods§

Source

fn establish( stream: BoxTransport, options: ConnectOptions, ) -> BoxFuture<'static, ClientResult<Established<Self::Ready>>>

Consume an owned stream and preserve any prefetched bytes in the result.

Source

fn prepare(ready: &Self::Ready, wire_name: &str) -> ClientResult<SendMetadata>

Validate availability and select metadata for a named outbound message.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§