Trait HasLen
Other items invalidator
pub trait HasLen { fn length(&self) -> u64; }
Trait to implement if one wants to make the length validator work for more types
length
A bit sad it’s not there by default in Rust
fn length(&self) -> u64
impl HasLen for String
impl<'a> HasLen for &'a String
impl<'a> HasLen for &'a str
impl<'a> HasLen for Cow<'a, str>
impl<T> HasLen for Vec<T>
impl<'a, T> HasLen for &'a Vec<T>