Struct rust_p2p_core::pipe::tcp_pipe::TcpPipeLine
source · pub struct TcpPipeLine { /* private fields */ }Implementations§
source§impl TcpPipeLine
impl TcpPipeLine
source§impl TcpPipeLine
impl TcpPipeLine
pub async fn into_raw(self) -> Result<(OwnedWriteHalf, OwnedReadHalf)>
source§impl TcpPipeLine
impl TcpPipeLine
sourcepub async fn send_to(&self, buf: &[u8], route_key: &RouteKey) -> Result<()>
pub async fn send_to(&self, buf: &[u8], route_key: &RouteKey) -> Result<()>
Writing buf to the target denoted by route_key via this pipeline
sourcepub async fn recv_from(&mut self, buf: &mut [u8]) -> Result<(usize, RouteKey)>
pub async fn recv_from(&mut self, buf: &mut [u8]) -> Result<(usize, RouteKey)>
Receive bytes from this pipeline, which the configured Decoder pre-processes
usize in the Ok branch indicates how many bytes are received
RouteKey in the Ok branch denotes the source where these bytes are received from
Auto Trait Implementations§
impl Freeze for TcpPipeLine
impl !RefUnwindSafe for TcpPipeLine
impl Send for TcpPipeLine
impl Sync for TcpPipeLine
impl Unpin for TcpPipeLine
impl !UnwindSafe for TcpPipeLine
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more