Skip to main content

ExtendFromSliceUnchecked

Trait ExtendFromSliceUnchecked 

Source
pub trait ExtendFromSliceUnchecked<T> {
    // Required method
    unsafe fn extend_from_slice_unchecked(&mut self, other: &[T]);
}
Expand description

A trait for extend_from_slice without the capacity check.

Required Methods§

Source

unsafe fn extend_from_slice_unchecked(&mut self, other: &[T])

Clones and appends all elements in a slice to the collection.

§Safety

The capacity of the collection must be sufficient for the new items.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

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

Source§

unsafe fn extend_from_slice_unchecked(&mut self, other: &[T])

Self::extend_from_slice without the capacity check.

§Safety

other.len() must be <= self.capacity() - self.len().

Implementors§