pub struct SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,{ /* private fields */ }
Expand description
Safe, generic interface to BaseArray
.
Uses length information to guarrantee memory safety, and excludes operations that cannot be performed safely from its API.
Trait Implementations§
Source§impl<E, L, P> Container for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
impl<E, L, P> Container for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
Source§impl<E, L, P> CopyMap<usize, E> for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
impl<E, L, P> CopyMap<usize, E> for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
Source§impl<E, L, P> DefaultLabelledArray<E, L> for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
E: Default,
impl<E, L, P> DefaultLabelledArray<E, L> for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
E: Default,
Source§impl<E, L, P> Drop for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
impl<E, L, P> Drop for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
Source§impl<'a, E, L, P> IntoIterator for &'a SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
impl<'a, E, L, P> IntoIterator for &'a SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
Source§impl<'a, E, L, P> IntoIterator for &'a mut SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
impl<'a, E, L, P> IntoIterator for &'a mut SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
Source§impl<E, L, P> IntoIterator for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
impl<E, L, P> IntoIterator for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
Source§impl<E, L, P> LabelledArray<E, L> for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
impl<E, L, P> LabelledArray<E, L> for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
Source§fn with_label<F>(label: L, len: usize, func: F) -> Self
fn with_label<F>(label: L, len: usize, func: F) -> Self
Create a new array, with values initialized using a provided
function, and label initialized to a provided value.
Source§unsafe fn get_unchecked(&self, idx: usize) -> &E
unsafe fn get_unchecked(&self, idx: usize) -> &E
Get a reference to the element at a specified index.
Implementations of this method shouldn’t do any safety checks.
Source§impl<E, L, P> LabelledArrayMut<E, L> for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
impl<E, L, P> LabelledArrayMut<E, L> for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
Source§fn get_label_mut(&mut self) -> &mut L
fn get_label_mut(&mut self) -> &mut L
Get mutable reference to the label.
Source§unsafe fn get_mut_unchecked(&mut self, idx: usize) -> &mut E
unsafe fn get_mut_unchecked(&mut self, idx: usize) -> &mut E
Get a mutable reference to the element at a specified index.
Implementations of this method shouldn’t do any safety checks.
Source§impl<E, L, P> SliceArray<E> for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
impl<E, L, P> SliceArray<E> for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
Source§impl<E, L, P> SliceArrayMut<E> for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
impl<E, L, P> SliceArrayMut<E> for SafeArray<E, L, P>where
P: SafeArrayPtr<E, L>,
Source§fn as_slice_mut(&mut self) -> &mut [E]
fn as_slice_mut(&mut self) -> &mut [E]
Returns a mutable reference to a slice into the elements of this array.
impl<E, L, P> Send for SafeArray<E, L, P>
impl<E, L, P> Sync for SafeArray<E, L, P>
Auto Trait Implementations§
impl<E, L, P> Freeze for SafeArray<E, L, P>where
P: Freeze,
impl<E, L, P> RefUnwindSafe for SafeArray<E, L, P>
impl<E, L, P> Unpin for SafeArray<E, L, P>
impl<E, L, P> UnwindSafe for SafeArray<E, L, P>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more