Trait gear_common::storage::Dequeue
source · pub trait Dequeue {
type Key;
type Value;
type Error;
// Required methods
fn mutate_values<F: FnMut(Self::Value) -> Self::Value>(f: F);
fn pop_back() -> Result<Option<Self::Value>, Self::Error>;
fn pop_front() -> Result<Option<Self::Value>, Self::Error>;
fn push_back(key: Self::Key, value: Self::Value) -> Result<(), Self::Error>;
fn push_front(key: Self::Key, value: Self::Value) -> Result<(), Self::Error>;
fn clear();
}
Expand description
Represents dequeue implementation.
Required Associated Types§
Required Methods§
sourcefn mutate_values<F: FnMut(Self::Value) -> Self::Value>(f: F)
fn mutate_values<F: FnMut(Self::Value) -> Self::Value>(f: F)
Mutates all stored value with given function.
sourcefn pop_back() -> Result<Option<Self::Value>, Self::Error>
fn pop_back() -> Result<Option<Self::Value>, Self::Error>
Removes and returns tail value of the dequeue, if present.
sourcefn pop_front() -> Result<Option<Self::Value>, Self::Error>
fn pop_front() -> Result<Option<Self::Value>, Self::Error>
Removes and returns head value of the dequeue, if present.
sourcefn push_back(key: Self::Key, value: Self::Value) -> Result<(), Self::Error>
fn push_back(key: Self::Key, value: Self::Value) -> Result<(), Self::Error>
Inserts value to the end of dequeue with given key.
Object Safety§
This trait is not object safe.