Skip to main content

Len

Trait Len 

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

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

Abstraction over payload containers stored in a TopicMatcherNode, used to detect when a node’s payload has become empty and can be pruned.

Required Methods§

Source

fn len(&self) -> usize

Number of elements currently held.

Provided Methods§

Source

fn is_empty(&self) -> bool

Returns true when the container holds no elements.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<K, V> Len for HashMap<K, V>

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Source§

impl<T> Len for HashSet<T>

Source§

fn len(&self) -> usize

Source§

fn is_empty(&self) -> bool

Implementors§