Skip to main content

Length

Trait Length 

Source
pub trait Length {
    // Required methods
    fn count_some(&self) -> usize;
    fn count(&self) -> usize;
}
Expand description

Determine number of non-None elements

Required Methods§

Source

fn count_some(&self) -> usize

Return number of non-None elements in the data structure

Source

fn count(&self) -> usize

Return number of all elements in the data structure, including None

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Length for DataContract

Source§

fn count_some(&self) -> usize

Source§

fn count(&self) -> usize

Source§

impl Length for Document

Source§

fn count_some(&self) -> usize

Source§

fn count(&self) -> usize

Source§

impl Length for IdentitiesContractKeys

Source§

fn count_some(&self) -> usize

Source§

fn count(&self) -> usize

Source§

impl Length for Identity

Source§

fn count_some(&self) -> usize

Source§

fn count(&self) -> usize

Source§

impl<K, T> Length for BTreeMap<K, Option<T>>

Source§

fn count_some(&self) -> usize

Source§

fn count(&self) -> usize

Source§

impl<K, T> Length for Vec<(K, Option<T>)>

Source§

fn count_some(&self) -> usize

Source§

fn count(&self) -> usize

Source§

impl<T: Length> Length for Option<T>

Source§

fn count_some(&self) -> usize

Source§

fn count(&self) -> usize

Source§

impl<T> Length for Vec<Option<T>>

Source§

fn count_some(&self) -> usize

Source§

fn count(&self) -> usize

Implementors§