Trait Countable

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

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

A trait for collections that are countable.

Required Methods§

Source

fn count(&self) -> usize

Returns the number of elements in the collection.

Provided Methods§

Source

fn is_empty(&self) -> bool

Checks whether the collection is empty.

Source

fn is_nonempty(&self) -> bool

Checks whether the collection is nonempty.

Implementors§