pub struct Sender<T> { /* private fields */ }
Expand description
A channel sender that orders messages by an index
It’s cheap to clone
Implementations§
Source§impl<T: Send> Sender<T>
impl<T: Send> Sender<T>
Sourcepub fn send(&self, index: usize, item: T) -> Result<(), SendError<T>>
pub fn send(&self, index: usize, item: T) -> Result<(), SendError<T>>
It’s important that indexes are consecutive and have no holes.
Count starts at 0. Indexes from iter().enumerate()
will work great.
If any integer is missing, the receiver will wait for it until all senders are dropped.
If any integer is sent more than once, only the first one received is going to be ordered, and the order of the remaining ones is undefined.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Sender<T>
impl<T> RefUnwindSafe for Sender<T>
impl<T> Send for Sender<T>where
T: Send,
impl<T> Sync for Sender<T>where
T: Send,
impl<T> Unpin for Sender<T>
impl<T> UnwindSafe for Sender<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