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: RThe 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>where
R: Deserialize<'de> + RowIndex,
C: Deserialize<'de> + ColumnIndex,
impl<'de, R, C> Deserialize<'de> for Row<R, C>where R: Deserialize<'de> + RowIndex, C: Deserialize<'de> + ColumnIndex,
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, C> From<(R, Vec<(C, Datum), Global>)> for Row<R, C>where
R: RowIndex,
C: ColumnIndex,
impl<R, C> From<(R, Vec<(C, Datum), Global>)> for Row<R, C>where R: RowIndex, C: ColumnIndex,
source§impl<R: PartialEq + RowIndex, C: PartialEq + ColumnIndex> PartialEq<Row<R, C>> for Row<R, C>
impl<R: PartialEq + RowIndex, C: PartialEq + ColumnIndex> PartialEq<Row<R, C>> for Row<R, C>
impl<R: RowIndex, C: ColumnIndex> StructuralPartialEq for Row<R, C>
Auto Trait Implementations§
impl<R, C> RefUnwindSafe for Row<R, C>where C: RefUnwindSafe, R: RefUnwindSafe,
impl<R, C> Send for Row<R, C>where C: Send, R: Send,
impl<R, C> Sync for Row<R, C>where C: Sync, R: Sync,
impl<R, C> Unpin for Row<R, C>where C: Unpin, R: Unpin,
impl<R, C> UnwindSafe for Row<R, C>where C: UnwindSafe, R: 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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.