Skip to main content

ArrayVecExt

Trait ArrayVecExt 

Source
pub trait ArrayVecExt<T> {
    // Required method
    fn extend_from_slice(&mut self, other: &[T]) -> &mut Self;
}
Expand description

Adds fluent slice extension to fixed-capacity vectors.

Elements are copied into the vector’s inline storage. The returned mutable reference permits continued method chaining.

Required Methods§

Source

fn extend_from_slice(&mut self, other: &[T]) -> &mut Self

Appends every element from other and returns the vector.

The operation copies the slice without allocating fallback storage. On success, each slice element is appended in order.

§Panics

Panics when the remaining capacity cannot hold the entire slice.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T: Copy, const CAP: usize> ArrayVecExt<T> for ArrayVec<T, CAP>

Source§

fn extend_from_slice(&mut self, other: &[T]) -> &mut Self

Implementors§