Struct dfqueue::DFQueue

source ·
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>

source

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().

source

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.

source

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§

source§

impl<T: Debug> Debug for DFQueue<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.