pub fn length_delimited<W: AsyncWrite, R: AsyncRead>(
    writer: W,
    reader: R,
    length_field_bytes: usize,
    max_length: usize,
) -> (
    Sender<Bincode, LengthDelimitedCodec, W>,
    Receiver<Bincode, LengthDelimitedCodec, R>,
) {
    let make_codec = || {
        LengthDelimitedCodec::builder()
            .max_frame_length(max_length)
            .length_field_length(length_field_bytes)
            .new_codec()
    };
    (
        Sender::new(Bincode::default(), make_codec(), writer),
        Receiver::new(Bincode::default(), make_codec(), reader),
    )
}
/// Pairs the [`Bincode`] serialization format with the
/// [`LengthDelimitedCodec`](tokio_util::codec::LengthDelimitedCodec) for framing, returning a
/// symmetrical pair of [`Sender`] and [`Receiver`].
///
/// The `length_field_bytes` parameter indicates how many bytes to use for representing the length
/// of each frame on the wire, and must range between 1 and 8, inclusive.
///
/// The `max_length` parameter indicates the maximum length of any message received or sent. An
/// error is thrown during encoding and decoding if a message would exceed this length.


The `length_field_bytes` parameter indicates how many bytes to use for representing the length
of each frame on the wire, and must range between 1 and 8, inclusive.

The `max_length` parameter indicates the maximum length of any message received or sent. An
error is thrown during encoding and decoding if a message would exceed this length.
The ` length_field_bytes ` parameter indicates how many bytes to use for representing the length of each frame on the wire and must range between 1 and 8 inclusive . The ` max_length ` parameter indicates the maximum length of any message received or sent . An error is thrown during encoding and decoding if a message would exceed this length .
pub fn length_delimited<W: AsyncWrite, R: AsyncRead>(
    writer: W,
    reader: R,
    length_field_bytes: usize,
    max_length: usize,
) -> (
    Sender<Bincode, LengthDelimitedCodec, W>,
    Receiver<Bincode, LengthDelimitedCodec, R>,
) {
    let make_codec = || {
        LengthDelimitedCodec::builder()
            .max_frame_length(max_length)
            .length_field_length(length_field_bytes)
            .new_codec()
    };
    (
        Sender::new(Bincode::default(), make_codec(), writer),
        Receiver::new(Bincode::default(), make_codec(), reader),
    )
}
pub fn length_delimited < W : AsyncWrite , R : AsyncRead > ( writer : W , reader : R , length_field_bytes : usize , max_length : usize , ) -> ( Sender < Bincode , LengthDelimitedCodec , W > , Receiver < Bincode , LengthDelimitedCodec , R > , ) { let make_codec = | | { LengthDelimitedCodec :: builder ( ) . max_frame_length ( max_length ) . length_field_length ( length_field_bytes ) . new_codec ( ) } ; ( Sender :: new ( Bincode :: default ( ) , make_codec ( ) , writer ) , Receiver :: new ( Bincode :: default ( ) , make_codec ( ) , reader ) , ) }
Pairs the [`Bincode`] serialization format with the
[`LengthDelimitedCodec`](tokio_util::codec::LengthDelimitedCodec) for framing, returning a
symmetrical pair of [`Sender`] and [`Receiver`].
Pairs the [ ` Bincode ` ] serialization format with the [ ` LengthDelimitedCodec ` ] ( tokio_util :: codec :: LengthDelimitedCodec ) for framing returning a symmetrical pair of [ ` Sender ` ] and [ ` Receiver ` ] .
writer
W
reader
R
length_field_bytes
usize
max_length
usize