Skip to main content

PushUnchecked

Trait PushUnchecked 

Source
pub trait PushUnchecked<T> {
    // Required method
    unsafe fn push_unchecked(&mut self, value: T);
}
Expand description

A trait for push without the capacity check.

Required Methods§

Source

unsafe fn push_unchecked(&mut self, value: T)

Appends an element to the back of a collection without the capacity check.

§Safety

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

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> PushUnchecked<T> for Vec<T>

Source§

unsafe fn push_unchecked(&mut self, value: T)

Self::push without the capacity check.

§Safety

self.len() must be < self.capacity().

Implementors§

Source§

impl<S: GenericString> PushUnchecked<char> for S