Skip to main content

RpcTransport

Trait RpcTransport 

pub trait RpcTransport: Send + 'static {
    // Required methods
    fn writer(&self) -> Sender<String>;
    fn next_frame<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn peer_label(&self) -> String;
    fn kind(&self) -> TransportKind;

    // Provided method
    fn credential(&self) -> Credential { ... }
}

Required Methods§

Source

fn writer(&self) -> Sender<String>

Source

fn next_frame<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn peer_label(&self) -> String

Source

fn kind(&self) -> TransportKind

Which transport class this connection arrived on.

Provided Methods§

Source

fn credential(&self) -> Credential

The transport-intrinsic credential: the kernel-reported peer uid on Unix sockets. Credential::None when the transport supplies nothing (remote WSS, Windows named pipes) — those connections authenticate by presenting an explicit credential in initialize.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl RpcTransport for LocalTransport

Source§

impl<S> RpcTransport for WssTransport<S>
where S: AsyncRead + AsyncWrite + Unpin + Send + 'static,