fedimint_server::net::framed

Type Alias TcpBidiFramed

Source
pub type TcpBidiFramed<T> = BidiFramed<T, OwnedWriteHalf, OwnedReadHalf>;
Expand description

Special case for tokio TcpStream based BidiFramed instances

Aliased Type§

struct TcpBidiFramed<T> {
    sink: FramedWrite<OwnedWriteHalf, BincodeCodec<T>>,
    stream: FramedRead<OwnedReadHalf, BincodeCodec<T>>,
}

Fields§

§sink: FramedWrite<OwnedWriteHalf, BincodeCodec<T>>§stream: FramedRead<OwnedReadHalf, BincodeCodec<T>>

Implementations§

Source§

impl<T> TcpBidiFramed<T>

Source

pub fn new_from_tcp(stream: TcpStream) -> TcpBidiFramed<T>

Special constructor for tokio TCP connections.

Tokio TcpStream implements an efficient method of splitting the stream into a read and a write half this constructor takes advantage of.