[−][src]Struct market::UnlimitedQueue
Defines a queue with unlimited size that implements Consumer
and Producer
.
An UnlimitedQueue
can be closed, which prevents the Producer
from producing new goods while allowing the Consumer
to consume only the remaining goods on the queue.
Methods
impl<G> UnlimitedQueue<G>
[src]
#[must_use]pub fn new() -> Self
[src]
Creates a new empty UnlimitedQueue
.
pub fn close(&self)
[src]
Closes self
.
Trait Implementations
impl<G> Consumer for UnlimitedQueue<G>
[src]
type Good = G
The item being consumed.
type Error = ClosedMarketError
The error when Self
is not functional. Read more
fn consume(&self) -> Result<Option<Self::Good>, Self::Error>
[src]
fn demand(&self) -> Result<Self::Good, Self::Error>
[src]
fn goods(&self) -> GoodsIter<Self> where
Self: Sized,
[src]
Self: Sized,
impl<G: Debug> Debug for UnlimitedQueue<G>
[src]
impl<G> Default for UnlimitedQueue<G>
[src]
impl<G> Producer for UnlimitedQueue<G>
[src]
type Good = G
The item being produced.
type Error = ClosedMarketError
The error when Self
is not functional. Read more
fn produce(&self, good: Self::Good) -> Result<Option<Self::Good>, Self::Error>
[src]
fn produce_all(
&self,
goods: Vec<Self::Good>
) -> Result<Vec<Self::Good>, Self::Error>
[src]
&self,
goods: Vec<Self::Good>
) -> Result<Vec<Self::Good>, Self::Error>
fn force(&self, good: Self::Good) -> Result<(), Self::Error>
[src]
Auto Trait Implementations
impl<G> RefUnwindSafe for UnlimitedQueue<G> where
G: RefUnwindSafe,
G: RefUnwindSafe,
impl<G> Send for UnlimitedQueue<G> where
G: Send,
G: Send,
impl<G> Sync for UnlimitedQueue<G> where
G: Send,
G: Send,
impl<G> Unpin for UnlimitedQueue<G> where
G: Unpin,
G: Unpin,
impl<G> !UnwindSafe for UnlimitedQueue<G>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,