Struct MemorySlice

Source
pub struct MemorySlice<C> { /* private fields */ }

Implementations§

Source§

impl<C: Clone> MemorySlice<C>

Source

pub fn check_correct_dims( memory_slice: &MemorySlice<C>, access: &[SliceCapacity], new_values: &MemorySlice<C>, is_strict: bool, ) -> Result<(), MemoryError>

Source

pub fn new(initial_value: &C) -> MemorySlice<C>

Source

pub fn new_array(route: Vec<SliceCapacity>, values: Vec<C>) -> MemorySlice<C>

Source

pub fn new_with_route( route: &[SliceCapacity], initial_value: &C, ) -> MemorySlice<C>

Source

pub fn insert_values( memory_slice: &mut MemorySlice<C>, access: &[SliceCapacity], new_values: &MemorySlice<C>, is_strict: bool, ) -> Result<(), MemoryError>

Source

pub fn insert_value_by_index( memory_slice: &mut MemorySlice<C>, index: usize, new_value: C, ) -> Result<(), MemoryError>

Source

pub fn get_access_index( memory_slice: &MemorySlice<C>, index: usize, ) -> Result<Vec<SliceCapacity>, MemoryError>

Source

pub fn access_values( memory_slice: &MemorySlice<C>, access: &[SliceCapacity], ) -> Result<MemorySlice<C>, MemoryError>

Source

pub fn access_value_by_index( memory_slice: &MemorySlice<C>, index: usize, ) -> Result<C, MemoryError>

Source

pub fn get_reference_to_single_value<'a>( memory_slice: &'a MemorySlice<C>, access: &[SliceCapacity], ) -> Result<&'a C, MemoryError>

Source

pub fn get_reference_to_single_value_by_index<'a>( memory_slice: &'a MemorySlice<C>, index: usize, ) -> Result<&'a C, MemoryError>

Source

pub fn get_reference_to_single_value_by_index_or_break<'a>( memory_slice: &'a MemorySlice<C>, index: usize, ) -> &'a C

Source

pub fn get_mut_reference_to_single_value<'a>( memory_slice: &'a mut MemorySlice<C>, access: &[SliceCapacity], ) -> Result<&'a mut C, MemoryError>

Source

pub fn get_number_of_cells(memory_slice: &MemorySlice<C>) -> SliceCapacity

Source

pub fn route(&self) -> &[SliceCapacity]

Source

pub fn is_single(&self) -> bool

Source

pub fn unwrap_to_single(memory_slice: MemorySlice<C>) -> C

Source

pub fn destruct(self) -> (Vec<SliceCapacity>, Vec<C>)

Trait Implementations§

Source§

impl<C: Clone> Clone for MemorySlice<C>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<C: Default + Clone + Display + Eq> Display for MemorySlice<C>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<C: PartialEq> PartialEq for MemorySlice<C>

Source§

fn eq(&self, other: &MemorySlice<C>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

const fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<C: Eq> Eq for MemorySlice<C>

Source§

impl<C> StructuralPartialEq for MemorySlice<C>

Auto Trait Implementations§

§

impl<C> Freeze for MemorySlice<C>

§

impl<C> RefUnwindSafe for MemorySlice<C>
where C: RefUnwindSafe,

§

impl<C> Send for MemorySlice<C>
where C: Send,

§

impl<C> Sync for MemorySlice<C>
where C: Sync,

§

impl<C> Unpin for MemorySlice<C>
where C: Unpin,

§

impl<C> UnwindSafe for MemorySlice<C>
where C: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V