pub struct BoundedSender<T> { /* private fields */ }Expand description
Sending half of a bounded channel. Cloneable for multiple producers.
Implementations§
Source§impl<T> BoundedSender<T>
impl<T> BoundedSender<T>
Sourcepub async fn send(&mut self, val: T) -> Result<(), SendError<T>>
pub async fn send(&mut self, val: T) -> Result<(), SendError<T>>
Sends val, parking until space is available.
Returns Err if the receiver has been dropped.
Sourcepub fn try_send(&mut self, val: T) -> Result<(), TrySendError<T>>
pub fn try_send(&mut self, val: T) -> Result<(), TrySendError<T>>
Sends val without waiting.
Returns Err(Full) if the channel is at capacity, or Err(Closed) if the receiver
has been dropped.
Trait Implementations§
Source§impl<T> Clone for BoundedSender<T>
impl<T> Clone for BoundedSender<T>
Auto Trait Implementations§
impl<T> Freeze for BoundedSender<T>
impl<T> !RefUnwindSafe for BoundedSender<T>
impl<T> !Send for BoundedSender<T>
impl<T> !Sync for BoundedSender<T>
impl<T> Unpin for BoundedSender<T>
impl<T> UnsafeUnpin for BoundedSender<T>
impl<T> !UnwindSafe for BoundedSender<T>
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