SafeArrayOps

Trait SafeArrayOps 

Source
pub trait SafeArrayOps<T> {
    // Required methods
    fn safe_get(&self, index: &[usize]) -> Option<&T>;
    fn safe_get_mut(&mut self, index: &[usize]) -> Option<&mut T>;
    fn validate_dimensions(&self) -> Result<(), String>;
    fn is_valid_index(&self, index: &[usize]) -> bool;
}
Expand description

Safe array operations trait

Required Methods§

Source

fn safe_get(&self, index: &[usize]) -> Option<&T>

Safe element access with bounds checking

Source

fn safe_get_mut(&mut self, index: &[usize]) -> Option<&mut T>

Safe mutable element access with bounds checking

Source

fn validate_dimensions(&self) -> Result<(), String>

Validate array dimensions and return error if invalid

Source

fn is_valid_index(&self, index: &[usize]) -> bool

Check if index is within bounds

Implementations on Foreign Types§

Source§

impl<T> SafeArrayOps<T> for ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>

Source§

fn safe_get(&self, index: &[usize]) -> Option<&T>

Source§

fn safe_get_mut(&mut self, index: &[usize]) -> Option<&mut T>

Source§

fn validate_dimensions(&self) -> Result<(), String>

Source§

fn is_valid_index(&self, index: &[usize]) -> bool

Source§

impl<T> SafeArrayOps<T> for ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>

Source§

fn safe_get(&self, index: &[usize]) -> Option<&T>

Source§

fn safe_get_mut(&mut self, index: &[usize]) -> Option<&mut T>

Source§

fn validate_dimensions(&self) -> Result<(), String>

Source§

fn is_valid_index(&self, index: &[usize]) -> bool

Implementors§