Trait WriteAt

Source
pub trait WriteAt<T> {
    // Required methods
    fn write_at(&mut self, index: usize, value: T);
    unsafe fn write_at_unchecked(&mut self, index: usize, value: T);
}
Expand description

A trait for objects which provide non-dropping indexed write access to their values.

Required Methods§

Source

fn write_at(&mut self, index: usize, value: T)

Performs a write of a memory location with the given value without reading or dropping the old value.

§Panics

Panics if index is out of bounds.

Source

unsafe fn write_at_unchecked(&mut self, index: usize, value: T)

Performs a write of a memory location with the given value without reading or dropping the old value.

For a safe alternative see WriteAt::write_at.

§Safety

Calling this method with an out-of-bounds index is undefined behavior.

Implementors§

Source§

impl<'a, T: 'a> WriteAt<T> for VolatileWriteOnlySlice<'a, T>

Source§

impl<'a, T: 'a> WriteAt<T> for WriteOnlySlice<'a, T>