Trait HasLength

Source
pub trait HasLength {
    // Required method
    fn length(&self) -> usize;
}
Expand description

Represents types that have length defined for their values.

Required Methods§

Source

fn length(&self) -> usize

Returns the value length.

Implementations on Foreign Types§

Source§

impl HasLength for str

Source§

fn length(&self) -> usize

Source§

impl HasLength for String

Available on crate features alloc or std only.
Source§

fn length(&self) -> usize

Source§

impl HasLength for OsStr

Available on crate feature std only.
Source§

fn length(&self) -> usize

Source§

impl HasLength for OsString

Available on crate feature std only.
Source§

fn length(&self) -> usize

Source§

impl HasLength for Path

Available on crate feature std only.
Source§

fn length(&self) -> usize

Source§

impl HasLength for PathBuf

Available on crate feature std only.
Source§

fn length(&self) -> usize

Source§

impl<K, V> HasLength for BTreeMap<K, V>

Available on crate features alloc or std only.
Source§

fn length(&self) -> usize

Source§

impl<K, V, S> HasLength for HashMap<K, V, S>

Available on crate feature std only.
Source§

fn length(&self) -> usize

Source§

impl<T> HasLength for [T]

Source§

fn length(&self) -> usize

Source§

impl<T> HasLength for BinaryHeap<T>

Available on crate features alloc or std only.
Source§

fn length(&self) -> usize

Source§

impl<T> HasLength for BTreeSet<T>

Available on crate features alloc or std only.
Source§

fn length(&self) -> usize

Source§

impl<T> HasLength for LinkedList<T>

Available on crate features alloc or std only.
Source§

fn length(&self) -> usize

Source§

impl<T> HasLength for VecDeque<T>

Available on crate features alloc or std only.
Source§

fn length(&self) -> usize

Source§

impl<T> HasLength for Vec<T>

Available on crate features alloc or std only.
Source§

fn length(&self) -> usize

Source§

impl<T, S> HasLength for HashSet<T, S>

Available on crate feature std only.
Source§

fn length(&self) -> usize

Source§

impl<T: ToOwned + HasLength + ?Sized> HasLength for Cow<'_, T>

Available on crate features alloc or std only.
Source§

fn length(&self) -> usize

Source§

impl<T: HasLength + ?Sized> HasLength for &T

Source§

fn length(&self) -> usize

Source§

impl<T: HasLength + ?Sized> HasLength for Box<T>

Available on crate features alloc or std only.
Source§

fn length(&self) -> usize

Source§

impl<T: HasLength + ?Sized> HasLength for Rc<T>

Available on crate features alloc or std only.
Source§

fn length(&self) -> usize

Source§

impl<T: HasLength + ?Sized> HasLength for Arc<T>

Available on crate features alloc or std only.
Source§

fn length(&self) -> usize

Implementors§