nested

Trait Collection

Source
pub trait Collection: Index<Range<usize>> {
    // Required methods
    fn new() -> Self;
    fn with_capacity(cap: usize) -> Self;
    fn len(&self) -> usize;
    fn truncate(&mut self, len: usize);
    fn extend_from_slice(&mut self, s: &<Self as Index<Range<usize>>>::Output);
    fn split_off(&mut self, at: usize) -> Self;
}
Expand description

A Collection trait to expose basic required fn for Nested to work properly

Required Methods§

Source

fn new() -> Self

Source

fn with_capacity(cap: usize) -> Self

Source

fn len(&self) -> usize

Source

fn truncate(&mut self, len: usize)

Source

fn extend_from_slice(&mut self, s: &<Self as Index<Range<usize>>>::Output)

Source

fn split_off(&mut self, at: usize) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Collection for String

Source§

fn len(&self) -> usize

Source§

fn new() -> Self

Source§

fn with_capacity(cap: usize) -> Self

Source§

fn truncate(&mut self, len: usize)

Source§

fn extend_from_slice(&mut self, s: &<Self as Index<Range<usize>>>::Output)

Source§

fn split_off(&mut self, at: usize) -> Self

Source§

impl<T: Clone> Collection for Vec<T>

Source§

fn len(&self) -> usize

Source§

fn new() -> Self

Source§

fn with_capacity(cap: usize) -> Self

Source§

fn truncate(&mut self, len: usize)

Source§

fn extend_from_slice(&mut self, s: &<Self as Index<Range<usize>>>::Output)

Source§

fn split_off(&mut self, at: usize) -> Self

Implementors§