Struct ordered_channel::Sender
source · 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 and no duplicates.
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.
Trait Implementations§
Auto Trait Implementations§
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