fedimint_server::net::framed

Trait FramedTransport

Source
pub trait FramedTransport<T>: Sink<T, Error = Error> + Stream<Item = Result<T, Error>> {
    // Required method
    fn borrow_split(
        &mut self,
    ) -> (&mut (dyn Sink<T, Error = Error> + Send + Unpin), &mut (dyn Stream<Item = Result<T, Error>> + Send + Unpin));

    // Provided method
    fn into_dyn(self) -> AnyFramedTransport<T>
       where Self: Sized + Send + Unpin + 'static { ... }
}
Expand description

A bidirectional framed transport adapter that can be split into its read and write half

Required Methods§

Source

fn borrow_split( &mut self, ) -> (&mut (dyn Sink<T, Error = Error> + Send + Unpin), &mut (dyn Stream<Item = Result<T, Error>> + Send + Unpin))

Split the framed transport into read and write half

Provided Methods§

Source

fn into_dyn(self) -> AnyFramedTransport<T>
where Self: Sized + Send + Unpin + 'static,

Transforms concrete FramedTransport object into an owned trait object

Implementors§

Source§

impl<T, WH, RH> FramedTransport<T> for BidiFramed<T, WH, RH>
where T: Debug + Serialize + DeserializeOwned + Send, WH: AsyncWrite + Send + Unpin, RH: AsyncRead + Send + Unpin,