pub struct Receiver<T, Codec = Default> { /* private fields */ }
Available on crate feature
rch
only.Expand description
Receives arbitrary values from a remote endpoint.
Values may be or contain any channel from this crate.
Implementationsยง
sourceยงimpl<T, Codec> Receiver<T, Codec>
impl<T, Codec> Receiver<T, Codec>
sourcepub async fn recv(&mut self) -> Result<Option<T>, RecvError>
pub async fn recv(&mut self) -> Result<Option<T>, RecvError>
Receive an item from the remote endpoint.
sourcepub async fn close(&mut self)
pub async fn close(&mut self)
Close the channel.
This stops the remote endpoint from sending more data, but allows already sent data to be received.
sourcepub fn max_item_size(&self) -> usize
pub fn max_item_size(&self) -> usize
The maximum allowed size in bytes of an item to be received.
The default value is DEFAULT_MAX_ITEM_SIZE.
sourcepub fn set_max_item_size(&mut self, max_item_size: usize)
pub fn set_max_item_size(&mut self, max_item_size: usize)
Sets the maximum allowed size in bytes of an item to be received.
Trait Implementationsยง
Auto Trait Implementationsยง
impl<T, Codec> Freeze for Receiver<T, Codec>where
T: Freeze,
impl<T, Codec = Json> !RefUnwindSafe for Receiver<T, Codec>
impl<T, Codec> Send for Receiver<T, Codec>
impl<T, Codec = Json> !Sync for Receiver<T, Codec>
impl<T, Codec> Unpin for Receiver<T, Codec>
impl<T, Codec = Json> !UnwindSafe for Receiver<T, Codec>
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