[−][src]Struct mop_blocks::dr_matrix::DrMatrixRowConstructor
Constructs a new valid row in a easy and interactive manner.
This struct may panic when out of scope. Please see the Drop documentation in
the Trait Implementations section for more information.
#[derive(Debug, PartialEq)]
Methods
impl<'a, DS> DrMatrixRowConstructor<'a, DS> where
DS: Push<Input = <DS as Storage>::Item> + Storage, [src]
DS: Push<Input = <DS as Storage>::Item> + Storage,
pub fn clone_values_from_row<'b>(self, row: &'b [DS::Item]) -> Self where
DS::Item: Clone + 'b,
DS: Extend<&'b <DS as Storage>::Item>, [src]
DS::Item: Clone + 'b,
DS: Extend<&'b <DS as Storage>::Item>,
Clones all values of row into the current row.
Example
use mop_blocks::{doc_tests::capacited_dr_matrix_vec, dr_matrix::DrMatrixRef}; let mut a = capacited_dr_matrix_vec(); a.row_constructor().copy_values_from_row(&[1, 2, 3, 4, 5]).commit(); assert_eq!(a.as_ref(), DrMatrixRef::new(1, 5, &[1, 2, 3, 4, 5][..]));
pub fn commit(self)[src]
Commits the row construction, modifying the internal structure.
Example
use mop_blocks::{doc_tests::capacited_dr_matrix_vec, dr_matrix::DrMatrixRef}; let mut a = capacited_dr_matrix_vec(); a.row_constructor() .push_value(1) .push_value(2) .push_value(3) .push_value(4) .push_value(5) .commit(); assert_eq!(a.as_ref(), DrMatrixRef::new(1, 5, &[1, 2, 3, 4, 5][..]));
Assertions
- The number of inserted elements must be equal the number of columns of
Self.
use mop_blocks::{doc_tests::capacited_dr_matrix_vec, dr_matrix::DrMatrixRef}; let mut a = capacited_dr_matrix_vec(); a.row_constructor().push_value(1).commit();
pub fn copy_values_from_row<'b>(self, row: &'b [DS::Item]) -> Self where
DS::Item: Copy + 'b,
DS: Extend<&'b <DS as Storage>::Item>, [src]
DS::Item: Copy + 'b,
DS: Extend<&'b <DS as Storage>::Item>,
Copies all values of row into the current row.
Example
use mop_blocks::{doc_tests::capacited_dr_matrix_vec, dr_matrix::DrMatrixRef}; let mut a = capacited_dr_matrix_vec(); a.row_constructor().copy_values_from_row(&[1, 2, 3, 4, 5]).commit(); assert_eq!(a.as_ref(), DrMatrixRef::new(1, 5, &[1, 2, 3, 4, 5][..]));
pub fn push_value(self, value: DS::Item) -> Self[src]
Pushes a new value.
Example
use mop_blocks::{doc_tests::{capacited_dr_matrix_vec, dr_matrix_array}, dr_matrix::DrMatrixVec}; let mut a = capacited_dr_matrix_vec(); a.row_constructor() .push_value(1) .push_value(2) .push_value(3) .push_value(4) .push_value(5) .commit(); a.row_constructor() .push_value(6) .push_value(7) .push_value(8) .push_value(9) .push_value(10) .commit(); a.row_constructor() .push_value(11) .push_value(12) .push_value(13) .push_value(14) .push_value(15) .commit(); a.row_constructor() .push_value(16) .push_value(17) .push_value(18) .push_value(19) .push_value(20) .commit(); assert_eq!(a.as_ref(), dr_matrix_array().as_ref());
Trait Implementations
impl<'a, DS: Debug> Debug for DrMatrixRowConstructor<'a, DS>[src]
impl<'a, DS> Drop for DrMatrixRowConstructor<'a, DS>[src]
fn drop(&mut self)[src]
Some measures are taken to ensure a valid format and avoid unexpected runtime behavior.
Assertions
- Every single nonempty instance of
DrMatrixRowConstructormust end with a call to thecommitmethod.
use mop_blocks::{doc_tests::capacited_dr_matrix_vec, dr_matrix::DrMatrixVec}; let mut a = capacited_dr_matrix_vec(); a.row_constructor().push_value(1).push_value(2).push_value(3).push_value(4);
impl<'a, DS: PartialEq> PartialEq<DrMatrixRowConstructor<'a, DS>> for DrMatrixRowConstructor<'a, DS>[src]
fn eq(&self, other: &DrMatrixRowConstructor<'a, DS>) -> bool[src]
fn ne(&self, other: &DrMatrixRowConstructor<'a, DS>) -> bool[src]
impl<'a, DS> StructuralPartialEq for DrMatrixRowConstructor<'a, DS>[src]
Auto Trait Implementations
impl<'a, DS> Send for DrMatrixRowConstructor<'a, DS> where
DS: Send,
DS: Send,
impl<'a, DS> Sync for DrMatrixRowConstructor<'a, DS> where
DS: Sync,
DS: Sync,
impl<'a, DS> Unpin for DrMatrixRowConstructor<'a, DS>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> TraitCfg for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,