[−][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.
Implementations
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> where
G: Debug,
[src]
G: Debug,
type Good = G
The type of the item being consumed.
type Failure = ClosedMarketFailure
The type of the error that could be thrown during consumption.
fn consume(&self) -> Result<Self::Good, ConsumeError<Self::Failure>>
[src]
fn consume_all(&self) -> Result<Vec<Self::Good>, ConsumeError<Self::Failure>>
[src]
fn demand(&self) -> Result<Self::Good, Self::Failure>
[src]
fn adapt<G, F>(self) -> Adapter<Self, G, F> 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> where
G: Debug + Display,
[src]
G: Debug + Display,
type Good = G
The type of the item being produced.
type Failure = ClosedMarketFailure
The type of the error that could be thrown during production.
fn produce(&self, good: Self::Good) -> Result<(), ProduceError<Self::Failure>>
[src]
fn produce_or_recall(
&self,
good: Self::Good
) -> Result<(), Recall<Self::Good, Self::Failure>> where
Self::Good: Clone + Debug + Display,
[src]
&self,
good: Self::Good
) -> Result<(), Recall<Self::Good, Self::Failure>> where
Self::Good: Clone + Debug + Display,
fn force(&self, good: Self::Good) -> Result<(), Self::Failure> where
Self::Good: Clone + Debug + Display,
[src]
Self::Good: Clone + Debug + Display,
fn force_all(&self, goods: Vec<Self::Good>) -> Result<(), Self::Failure> where
Self::Good: Clone + Debug + Display,
[src]
Self::Good: Clone + Debug + Display,
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>,