pub struct Array { /* private fields */ }
Expand description
Describes a contiguous area in memory composed of Words.
Implementations§
Source§impl Array
impl Array
Sourcepub fn sub(&self, ignore_start: Address, ignore_end: Address) -> Self
pub fn sub(&self, ignore_start: Address, ignore_end: Address) -> Self
Gets a subset of the current array.
Sourcepub fn sub_from_start(&self, ignore_end: Address) -> Self
pub fn sub_from_start(&self, ignore_end: Address) -> Self
Gets a subset of the current array with its end trimmed.
Sourcepub fn sub_from_end(&self, ignore_start: Address) -> Self
pub fn sub_from_end(&self, ignore_start: Address) -> Self
Gets a subset of the current array with its start trimmed.
Sourcepub fn as_mut_slice(&mut self) -> &mut [Word]
pub fn as_mut_slice(&mut self) -> &mut [Word]
Returns a slice that shares the raw Words data.
Sourcepub fn next(&self, index: &mut Address) -> Option<Word>
pub fn next(&self, index: &mut Address) -> Option<Word>
Returns Some(Word) at the corresponding index.
Sourcepub fn iter(&self) -> Iter<'_, Word>
pub fn iter(&self) -> Iter<'_, Word>
Returns an iterator that gives immutable references to the elements in the collection in sequence.
Sourcepub fn insert(&mut self, address: Address, value: Word)
pub fn insert(&mut self, address: Address, value: Word)
Inserts an element to the array at a specific position.
Assumes that ‘address’ can be converted to a position in the array.
Sourcepub fn remove(&mut self, index: Address) -> Word
pub fn remove(&mut self, index: Address) -> Word
Removes and returns the element at position ‘index’ in the array.
Assumes that ‘index’ can be converted to a valid position in the array.
Sourcepub fn extract_word(&self, area: Area, cursor: Address) -> Word
pub fn extract_word(&self, area: Area, cursor: Address) -> Word
Extract one word inside an area from the array.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Array
impl RefUnwindSafe for Array
impl Send for Array
impl Sync for Array
impl Unpin for Array
impl UnwindSafe for Array
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