pub trait Len<L> {
// Required methods
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:
type | length description |
---|---|
&str , String | length in bytes |
Vec<T> | number of elements in the vector |
HashMap<K, V> , BTreeMap<K, V> | number of key/value pairs in the map |
TempFile | length of the file in bytes |
Option<T> where T: Len | length of T or 0 if None |
form::Result<'_, T> | length of T or 0 if Err |
Required Methods§
sourcefn len_into_u64(len: L) -> u64
fn len_into_u64(len: L) -> u64
Convert len
into u64
.
Object Safety§
This trait is not object safe.