Struct bolic_network::hub::endpoint::Receiver
source · pub struct Receiver<'a>(/* private fields */);Expand description
Handle for receiving data from an endpoint. It cannot be shared.
Implementations§
source§impl<'a> Receiver<'a>
impl<'a> Receiver<'a>
sourcepub async fn recv(&mut self, size: Option<usize>) -> Option<Bytes>
pub async fn recv(&mut self, size: Option<usize>) -> Option<Bytes>
Use None as size will retain the messages in the underlying transport and make it
zero-copy. Any other size will rechunk the data in the transport.
pub fn try_recv(&mut self) -> Result<Bytes, ReceiverError>
pub fn drain(&mut self) -> Vec<Bytes>
Auto Trait Implementations§
impl<'a> Freeze for Receiver<'a>
impl<'a> !RefUnwindSafe for Receiver<'a>
impl<'a> Send for Receiver<'a>
impl<'a> Sync for Receiver<'a>
impl<'a> Unpin for Receiver<'a>
impl<'a> !UnwindSafe for Receiver<'a>
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