Trait AppendCopy

Source
pub trait AppendCopy<T>
where T: Copy,
{ // Required method fn append_copy(&mut self, i: &[T]); }
Expand description

Collections that support extending themselves mutably from copyable slices

Required Methods§

Source

fn append_copy(&mut self, i: &[T])

Extend self mutably, copying from a slice.

Worst-case implementations copy 1 element at a time (time O(n))

Best-case implementations copy as much of the origin slice at once as possible (system word size), e.g. Vec::append. (still linear time, but on 64-bit systems this is 64 times faster than a 1-by-1 copy.)

Implementations on Foreign Types§

Source§

impl<T> AppendCopy<T> for Vec<T>
where T: Copy,

Source§

fn append_copy(&mut self, i: &[T])

Source§

impl<T, A> AppendCopy<T> for ArrayVec<A>
where T: Copy, A: Array<Item = T>,

Source§

fn append_copy(&mut self, i: &[T])

Implementors§