pub struct Vendor<T> { /* private fields */ }Expand description
Implementations§
Source§impl<T> Vendor<T>
impl<T> Vendor<T>
pub fn new() -> Self
Sourcepub fn send(&self, resource: T)where
T: Clone,
pub fn send(&self, resource: T)where
T: Clone,
Sends the resource to customers
Note, if no one is in the queue the resource will be lost
pub fn waiters_count(&self) -> usize
Sourcepub fn has_waiters(&self) -> bool
pub fn has_waiters(&self) -> bool
It may be useful to check the queue for waiting customers to do something only if someone is in the queue
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Vendor<T>
impl<T> RefUnwindSafe for Vendor<T>
impl<T> Send for Vendor<T>where
T: Send,
impl<T> Sync for Vendor<T>where
T: Send,
impl<T> Unpin for Vendor<T>
impl<T> UnwindSafe for Vendor<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