pub trait Counted {
    type Length: Default + PartialEq;

    // Required method
    fn len() -> Self::Length;

    // Provided method
    fn is_empty() -> bool { ... }
}
Expand description

Represents default counting logic, by providing ability to return length of the object as specified (associated) type or answer the question is the object empty.

Required Associated Types§

source

type Length: Default + PartialEq

Returning length type.

Required Methods§

source

fn len() -> Self::Length

Returns current Self’s amount of elements as Length type.

Provided Methods§

source

fn is_empty() -> bool

Returns bool, defining if Self doesn’t contain elements.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Key, Value, Error, HVS, TVS, MS, Callbacks> Counted 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>> + Counted, Callbacks: DequeueCallbacks<Value = Value>,

§

type Length = <MS as Counted>::Length

source§

impl<T, OutputError, KeyGen> Counted for QueueImpl<T, OutputError, KeyGen>
where T: Dequeue + Counted, OutputError: From<T::Error>, KeyGen: KeyFor<Key = T::Key, Value = T::Value>,

§

type Length = <T as Counted>::Length