pub struct ArrayArena { /* private fields */ }Expand description
Arena for storing 2D arrays
Implementations§
Source§impl ArrayArena
impl ArrayArena
pub fn new() -> Self
pub fn with_capacity(array_count: usize) -> Self
Sourcepub fn insert(
&mut self,
rows: u32,
cols: u32,
elements: Vec<ValueRef>,
) -> ArrayRef
pub fn insert( &mut self, rows: u32, cols: u32, elements: Vec<ValueRef>, ) -> ArrayRef
Insert a 2D array, returning its reference
Sourcepub fn insert_2d(&mut self, array: Vec<Vec<ValueRef>>) -> ArrayRef
pub fn insert_2d(&mut self, array: Vec<Vec<ValueRef>>) -> ArrayRef
Insert a 2D array from nested vectors
Sourcepub fn get_element(&self, r: ArrayRef, row: u32, col: u32) -> Option<ValueRef>
pub fn get_element(&self, r: ArrayRef, row: u32, col: u32) -> Option<ValueRef>
Get a specific element from an array
Sourcepub fn get_2d(&self, r: ArrayRef) -> Option<Vec<Vec<ValueRef>>>
pub fn get_2d(&self, r: ArrayRef) -> Option<Vec<Vec<ValueRef>>>
Reconstruct a 2D array from its reference
Sourcepub fn total_elements(&self) -> usize
pub fn total_elements(&self) -> usize
Returns the total number of elements across all arrays
Sourcepub fn memory_usage(&self) -> usize
pub fn memory_usage(&self) -> usize
Returns memory usage in bytes (approximate)
Trait Implementations§
Source§impl Debug for ArrayArena
impl Debug for ArrayArena
Auto Trait Implementations§
impl Freeze for ArrayArena
impl RefUnwindSafe for ArrayArena
impl Send for ArrayArena
impl Sync for ArrayArena
impl Unpin for ArrayArena
impl UnwindSafe for ArrayArena
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more