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
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.