polars_utils::slice

Trait GetSaferUnchecked

Source
pub trait GetSaferUnchecked<T> {
    // Required methods
    unsafe fn get_unchecked_release<I>(
        &self,
        index: I,
    ) -> &<I as SliceIndex<[T]>>::Output
       where I: SliceIndex<[T]>;
    unsafe fn get_unchecked_release_mut<I>(
        &mut self,
        index: I,
    ) -> &mut <I as SliceIndex<[T]>>::Output
       where I: SliceIndex<[T]>;
}

Required Methods§

Source

unsafe fn get_unchecked_release<I>( &self, index: I, ) -> &<I as SliceIndex<[T]>>::Output
where I: SliceIndex<[T]>,

§Safety

Calling this method with an out-of-bounds index is [undefined behavior] even if the resulting reference is not used.

Source

unsafe fn get_unchecked_release_mut<I>( &mut self, index: I, ) -> &mut <I as SliceIndex<[T]>>::Output
where I: SliceIndex<[T]>,

§Safety

Calling this method with an out-of-bounds index is [undefined behavior] even if the resulting reference is not used.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> GetSaferUnchecked<T> for [T]

Source§

unsafe fn get_unchecked_release<I>( &self, index: I, ) -> &<I as SliceIndex<[T]>>::Output
where I: SliceIndex<[T]>,

Source§

unsafe fn get_unchecked_release_mut<I>( &mut self, index: I, ) -> &mut <I as SliceIndex<[T]>>::Output
where I: SliceIndex<[T]>,

Implementors§