base_traits

Trait Len

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

Trait defining instance method len() : usize that indicates whether the implementing type instance is logically empty.

§Additional Implementations on Foreign Types

§Built-in Types

If the feature "implement-Len-for-built_ins" is defined (as it is by "default"), then this is also implemented for the following types:

  • str;
  • [T; N];
  • [T];

§Standard Collection Types

If the feature "implement-Len-for-standard_collection_types" is defined (as it is by "default"), then this is also implemented for the following types:

  • [std::collections::BTreeMap<>];
  • [std::collections::BTreeSet<>];
  • [std::collections::BinaryHeap<>];
  • [std::collections::HashMap<>];
  • [std::collections::HashSet<>];
  • [std::collections::LinkedList<>];
  • String;
  • [Vec<>];
  • [std::collections::VecDeque<>];

§Standard FFI Types

If the feature "implement-Len-for-standard_ffi_types" is defined (as it is by "default"), then this is also implemented for the following types:

§Standard Path Types

If the feature "implement-Len-for-standard_path_types" is defined (as it is by "default"), then this is also implemented for the following types:

§Standard Process Types

If the feature "implement-Len-for-standard_process_types" is defined (as it is by "default"), then this is also implemented for the following types:

Required Methods§

Source

fn len(&self) -> usize

Implementations on Foreign Types§

Source§

impl Len for &str

Source§

fn len(&self) -> usize

Source§

impl Len for &CStr

Source§

fn len(&self) -> usize

Source§

impl Len for &Path

Source§

fn len(&self) -> usize

Source§

impl Len for &PathBuf

Source§

fn len(&self) -> usize

Source§

impl Len for str

Source§

fn len(&self) -> usize

Source§

impl Len for CString

Source§

fn len(&self) -> usize

Source§

impl Len for String

Source§

fn len(&self) -> usize

Source§

impl Len for CStr

Source§

fn len(&self) -> usize

Source§

impl Len for PathBuf

Source§

fn len(&self) -> usize

Source§

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

Source§

fn len(&self) -> usize

Source§

impl<K, V> Len for HashMap<K, V>

Source§

fn len(&self) -> usize

Source§

impl<T> Len for &[T]

Source§

fn len(&self) -> usize

Source§

impl<T> Len for [T]

Source§

fn len(&self) -> usize

Source§

impl<T> Len for BinaryHeap<T>

Source§

fn len(&self) -> usize

Source§

impl<T> Len for BTreeSet<T>

Source§

fn len(&self) -> usize

Source§

impl<T> Len for LinkedList<T>

Source§

fn len(&self) -> usize

Source§

impl<T> Len for VecDeque<T>

Source§

fn len(&self) -> usize

Source§

impl<T> Len for Vec<T>

Source§

fn len(&self) -> usize

Source§

impl<T> Len for HashSet<T>

Source§

fn len(&self) -> usize

Source§

impl<T, const N: usize> Len for &[T; N]

Source§

fn len(&self) -> usize

Source§

impl<T, const N: usize> Len for [T; N]

Source§

fn len(&self) -> usize

Source§

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

Source§

fn len(&self) -> usize

Source§

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

Source§

fn len(&self) -> usize

Implementors§