pub trait CollectionLength {
    // Required method
    fn len(&self) -> usize;

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

For types which should have the a len method.

Required Methods§

source

fn len(&self) -> usize

Provided Methods§

source

fn is_empty(&self) -> bool

Implementations on Foreign Types§

source§

impl CollectionLength for Map<String, Value>

Available on crate feature serde_json only.
source§

fn len(&self) -> usize

source§

impl<K, T> CollectionLength for BTreeMap<K, T>

source§

fn len(&self) -> usize

source§

impl<K, T> CollectionLength for HashMap<K, T>

Available on crate feature std only.
source§

fn len(&self) -> usize

source§

impl<T> CollectionLength for BinaryHeap<T>

source§

fn len(&self) -> usize

source§

impl<T> CollectionLength for BTreeSet<T>

source§

fn len(&self) -> usize

source§

impl<T> CollectionLength for Vec<T>

source§

fn len(&self) -> usize

source§

impl<T> CollectionLength for HashSet<T>

Available on crate feature std only.
source§

fn len(&self) -> usize

Implementors§