pub struct DFQueue<T> { /* private fields */ }
Expand description
The actual queue, an opaque type that cannot be used directly.
The user must use DFQueueConsumer
and DFQueueProducer
.
Implementations§
source§impl<T> DFQueue<T>
impl<T> DFQueue<T>
sourcepub fn new() -> DFQueue<T>
pub fn new() -> DFQueue<T>
Creates a new DFQueue.
This object cannot be used directly, you must obtain a producer or consumer to the queue
using the functions into_consumer()
or obtain_producer()
.
sourcepub fn into_consumer(self) -> DFQueueConsumer<T>
pub fn into_consumer(self) -> DFQueueConsumer<T>
Consumes the DFQueue and returns the one and only consumer for this DFQueue. It consumes the DFQueue instance because there is only one consumer allowed per DFQueue.
sourcepub fn into_producer(self) -> DFQueueProducer<T>
pub fn into_producer(self) -> DFQueueProducer<T>
Consumes the DFQueue and returns a producer.
To obtain another DFQueueProducer for this DFQueue, call obtain_producer()
on the returned DFQueueProducer.
DFQueueProducer does not implement the standard Clone trait, to avoid accidentally cloning it implicity.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for DFQueue<T>
impl<T> Send for DFQueue<T>where T: Send,
impl<T> Sync for DFQueue<T>where T: Send,
impl<T> Unpin for DFQueue<T>
impl<T> UnwindSafe for DFQueue<T>where T: RefUnwindSafe,
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