pub trait Transport: Send + 'static {
type Body: Body;
type Info: Clone + Send + 'static;
type Config: Clone + Default + Send + Sync + 'static;
type ReadHalf<'a>: TransportReadHalf<Body = Self::Body> + 'a;
type WriteHalf<'a>: TransportWriteHalf<Body = Self::Body> + 'a;
// Required methods
fn split(&mut self) -> (Self::ReadHalf<'_>, Self::WriteHalf<'_>);
fn info(&self) -> Result<Self::Info>;
}
Expand description
Trait for types that represent a bi-direction message transport.
Note that you can not use the transport itself directly. Instead, you must split it in a read and write half and use those.
Required Associated Types§
sourcetype Info: Clone + Send + 'static
type Info: Clone + Send + 'static
Information about the underlying stream or connection of the transport.
sourcetype ReadHalf<'a>: TransportReadHalf<Body = Self::Body> + 'a
type ReadHalf<'a>: TransportReadHalf<Body = Self::Body> + 'a
The type of the read half of the transport.
sourcetype WriteHalf<'a>: TransportWriteHalf<Body = Self::Body> + 'a
type WriteHalf<'a>: TransportWriteHalf<Body = Self::Body> + 'a
The type of the write half of the transport.
Required Methods§
Object Safety§
This trait is not object safe.