pub struct Row<R: RowIndex, C: ColumnIndex> {
pub row_ix: R,
pub values: Vec<Value<C>>,
}
Expand description
A list of data for insertion into a certain row
§Example
use lace::Value;
use lace_data::Datum;
let row = Row::<&str, &str> {
row_ix: "vampire",
values: vec![
Value {
col_ix: "sucks_blood",
value: Datum::Categorical(1_u8.into()),
},
Value {
col_ix: "drinks_wine",
value: Datum::Categorical(0_u8.into()),
},
],
};
assert_eq!(row.len(), 2);
There are converters for convenience.
let row: Row<&str, &str> = (
"vampire",
vec![
("sucks_blood", Datum::Categorical(1_u8.into())),
("drinks_wine", Datum::Categorical(0_u8.into())),
]
).into();
assert_eq!(row.len(), 2);
Fields§
§row_ix: R
The name of the row
values: Vec<Value<C>>
The cells and values to fill in
Implementations§
Trait Implementations§
source§impl<'de, R, C> Deserialize<'de> for Row<R, C>
impl<'de, R, C> Deserialize<'de> for Row<R, C>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<R: PartialEq + RowIndex, C: PartialEq + ColumnIndex> PartialEq for Row<R, C>
impl<R: PartialEq + RowIndex, C: PartialEq + ColumnIndex> PartialEq for Row<R, C>
impl<R: RowIndex, C: ColumnIndex> StructuralPartialEq for Row<R, C>
Auto Trait Implementations§
impl<R, C> Freeze for Row<R, C>where
R: Freeze,
impl<R, C> RefUnwindSafe for Row<R, C>where
R: RefUnwindSafe,
C: RefUnwindSafe,
impl<R, C> Send for Row<R, C>
impl<R, C> Sync for Row<R, C>
impl<R, C> Unpin for Row<R, C>
impl<R, C> UnwindSafe for Row<R, C>where
R: UnwindSafe,
C: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.