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§

source

type Key

Dequeue’s elements stored key.

source

type Value

Dequeue’s elements stored value.

source

type Error

Dequeue error type.

Required Methods§

source

fn mutate_values<F: FnMut(Self::Value) -> Self::Value>(f: F)

Mutates all stored value with given function.

source

fn pop_back() -> Result<Option<Self::Value>, Self::Error>

Removes and returns tail value of the dequeue, if present.

source

fn pop_front() -> Result<Option<Self::Value>, Self::Error>

Removes and returns head value of the dequeue, if present.

source

fn push_back(key: Self::Key, value: Self::Value) -> Result<(), Self::Error>

Inserts value to the end of dequeue with given key.

source

fn push_front(key: Self::Key, value: Self::Value) -> Result<(), Self::Error>

Inserts value to the beginning of dequeue with given key.

source

fn clear()

Removes all values.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Key, Value, Error, HVS, TVS, MS, Callbacks> Dequeue for DequeueImpl<Key, Value, Error, HVS, TVS, MS, Callbacks>
where Key: Clone + PartialEq, Error: DequeueError, HVS: ValueStorage<Value = Key>, TVS: ValueStorage<Value = Key>, MS: MapStorage<Key = Key, Value = LinkedNode<Key, Value>>, Callbacks: DequeueCallbacks<Value = Value>,

§

type Key = Key

§

type Value = Value

§

type Error = Error