pub trait HasLength { fn len(&self) -> usize; fn is_empty(&self) -> bool { ... } }
Trait for data structures which have a length.
Return the length of the data structure.
Return whether the data structure is empty.