pub struct Sender<T, Codec = Default> { /* private fields */ }
Available on crate feature
rch
only.Expand description
Sends arbitrary values to a remote endpoint.
Values may be or contain any channel from this crate.
Implementations§
source§impl<T, Codec> Sender<T, Codec>
impl<T, Codec> Sender<T, Codec>
sourcepub async fn send(&mut self, item: T) -> Result<(), SendError<T>>
pub async fn send(&mut self, item: T) -> Result<(), SendError<T>>
Sends an item over the channel.
The item may contain ports that will be serialized and connected as well.
sourcepub fn closed(&self) -> Closed ⓘ
pub fn closed(&self) -> Closed ⓘ
Returns a future that will resolve when the remote endpoint closes its receiver.
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 sent.
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 sent.
This does not change the maximum allowed size on the receive end. Thus if the maximum allowed size is larger on the sender than on the receiver, sending of oversized items will succeed but the receiver will fail with a MaxItemSizeExceeded error when trying to receive the item.
Trait Implementations§
Auto Trait Implementations§
impl<T, Codec> Freeze for Sender<T, Codec>
impl<T, Codec = Json> !RefUnwindSafe for Sender<T, Codec>
impl<T, Codec> Send for Sender<T, Codec>
impl<T, Codec> Sync for Sender<T, Codec>
impl<T, Codec> Unpin for Sender<T, Codec>
impl<T, Codec = Json> !UnwindSafe for Sender<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