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§
Sourcefn safe_get_mut(&mut self, index: &[usize]) -> Option<&mut T>
fn safe_get_mut(&mut self, index: &[usize]) -> Option<&mut T>
Safe mutable element access with bounds checking
Sourcefn validate_dimensions(&self) -> Result<(), String>
fn validate_dimensions(&self) -> Result<(), String>
Validate array dimensions and return error if invalid
Sourcefn is_valid_index(&self, index: &[usize]) -> bool
fn is_valid_index(&self, index: &[usize]) -> bool
Check if index is within bounds