pub async fn send<U>(
        &self,
        item: U::Item,
        codec: &U,
    ) -> Result<(), Either<U::Error, io::Error>>
    where
        U: Encoder,
    {
        self.encode(item, codec).map_err(Either::Left)?;

        poll_fn(|cx| self.poll_flush(cx, true))
            .await
            .map_err(Either::Right)?;

        Ok(())
    }
/// Encode item, send to a peer
Encode item, send to a peer
Encode item send to a peer
pub async fn send<U>(
        &self,
        item: U::Item,
        codec: &U,
    ) -> Result<(), Either<U::Error, io::Error>>
    where
        U: Encoder,
    {
        self.encode(item, codec).map_err(Either::Left)?;
        poll_fn(|cx| self.poll_flush(cx, true))
            .await
            .map_err(Either::Right)?;
        Ok(())
    }
pub async fn send < U > ( & self , item : U :: Item , codec : & U , ) -> Result < ( ) , Either < U :: Error , io :: Error > > where U : Encoder , { self . encode ( item , codec ) . map_err ( Either :: Left ) ? ; poll_fn ( | cx | self . poll_flush ( cx , true ) ) . await . map_err ( Either :: Right ) ? ; Ok ( ( ) ) }
Encode item, send to a peer
Encode item send to a peer
&self
item
U::Item
codec
&U
&self
item
U::Item
codec
&U