Trait pear::input::Length

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

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

Trait implemented for types that have a length as required by the Input::Slice associated type.

Required Methods§

source

fn len(&self) -> usize

Returns the length of self.

While the units of length are unspecified, the returned value must be consistent with the use of n in the Input::slice() method. In particular, if Input::slice(n) returns Some(x), then x.len() must return n.

Provided Methods§

source

fn is_empty(&self) -> bool

Returns true iff the length of self is equal to zero.

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<'a> Length for &'a str

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 0]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 1]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 2]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 3]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 4]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 5]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 6]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 7]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 8]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 9]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 10]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 11]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 12]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 13]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 14]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 15]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 16]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 17]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 18]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 19]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 20]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 21]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 22]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 23]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 24]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 25]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 26]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 27]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 28]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 29]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 30]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 31]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T; 32]

source§

fn len(&self) -> usize

source§

impl<'a, T> Length for &'a [T]

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§

source§

impl<T> Length for Extent<T>