Trait Length

Source
pub trait Length {
    // Required method
    fn len(&self) -> usize;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

A trait for types whose values have a length, in bytes.

Required Methods§

Source

fn len(&self) -> usize

The size of the object in bytes

Provided Methods§

Source

fn is_empty(&self) -> bool

Implementations on Foreign Types§

Source§

impl Length for str

Source§

fn len(&self) -> usize

Source§

impl Length for String

Source§

fn len(&self) -> usize

Source§

impl<T> Length for [T]

Source§

fn len(&self) -> usize

Source§

impl<T> Length for Vec<T>

Source§

fn len(&self) -> usize

Implementors§