logo
pub trait Len<L> {
    fn len(&self) -> L;
    fn len_into_u64(len: L) -> u64;
    fn zero_len() -> L;
}
Expand description

Types for values that have a length.

At present, these are:

typelength description
&str, Stringlength in bytes
Vec<T>number of elements in the vector
HashMap<K, V>, BTreeMap<K, V>number of key/value pairs in the map
TempFilelength of the file in bytes
Option<T> where T: Lenlength of T or 0 if None
form::Result<'_, T>length of T or 0 if Err

Required Methods

The length of the value.

Convert len into u64.

The zero value for L.

Implementations on Foreign Types

Implementors