Trait gear_common::storage::Queue
source · pub trait Queue {
type Value;
type Error: DequeueError;
type OutputError: From<Self::Error>;
// Required methods
fn dequeue() -> Result<Option<Self::Value>, Self::OutputError>;
fn mutate_values<F: FnMut(Self::Value) -> Self::Value>(f: F);
fn queue(value: Self::Value) -> Result<(), Self::OutputError>;
fn clear();
fn requeue(value: Self::Value) -> Result<(), Self::OutputError>;
}
Expand description
Represents message queue managing logic.
Required Associated Types§
sourcetype Error: DequeueError
type Error: DequeueError
Inner error type of queue storing algorithm.
sourcetype OutputError: From<Self::Error>
type OutputError: From<Self::Error>
Output error type of the queue.
Required Methods§
sourcefn dequeue() -> Result<Option<Self::Value>, Self::OutputError>
fn dequeue() -> Result<Option<Self::Value>, Self::OutputError>
Removes and returns message from the beginning of the queue, if present,
sourcefn mutate_values<F: FnMut(Self::Value) -> Self::Value>(f: F)
fn mutate_values<F: FnMut(Self::Value) -> Self::Value>(f: F)
Mutates all values in queue with given function.
Object Safety§
This trait is not object safe.