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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.