pub struct Row { /* private fields */ }Expand description
Represents a single row in a data frame.
Implementations§
Source§impl Row
Functions for creating, mutating, and getting data from Rows.
impl Row
Functions for creating, mutating, and getting data from Rows.
Sourcepub fn new(schema: &Schema) -> Self
pub fn new(schema: &Schema) -> Self
Constructs a new Row with the given Schema and fills it with
Null values.
Sourcepub fn set_int(&mut self, col_idx: usize, data: i64) -> Result<(), LiquidError>
pub fn set_int(&mut self, col_idx: usize, data: i64) -> Result<(), LiquidError>
Sets the field in this Row at the given col_idx to have the given
data. The DataType at the col_idx must be an Int or it will
return a TypeMismatch error.
Sourcepub fn set_float(
&mut self,
col_idx: usize,
data: f64,
) -> Result<(), LiquidError>
pub fn set_float( &mut self, col_idx: usize, data: f64, ) -> Result<(), LiquidError>
Sets the field in this Row at the given col_idx to have the given
data. The DataType at the col_idx must be an Int or it will
return a TypeMismatch error.
Sourcepub fn set_bool(
&mut self,
col_idx: usize,
data: bool,
) -> Result<(), LiquidError>
pub fn set_bool( &mut self, col_idx: usize, data: bool, ) -> Result<(), LiquidError>
Sets the field in this Row at the given col_idx to have the given
data. The DataType at the col_idx must be an Int or it will
return a TypeMismatch error.
Sourcepub fn set_string(
&mut self,
col_idx: usize,
data: String,
) -> Result<(), LiquidError>
pub fn set_string( &mut self, col_idx: usize, data: String, ) -> Result<(), LiquidError>
Sets the field in this Row at the given col_idx to have the given
data. The DataType at the col_idx must be an Int or it will
return a TypeMismatch error.
Sourcepub fn set_null(&mut self, col_idx: usize) -> Result<(), LiquidError>
pub fn set_null(&mut self, col_idx: usize) -> Result<(), LiquidError>
Sets the field in this Row at the given col_idx to be Null.
Sourcepub fn get_idx(&self) -> Option<usize>
pub fn get_idx(&self) -> Option<usize>
Get the current index of this Row. Is Some if the index has been
set, and is None otherwise.
Sourcepub fn get(&self, idx: usize) -> Result<&Data, LiquidError>
pub fn get(&self, idx: usize) -> Result<&Data, LiquidError>
Get a reference of the boxed value at the given idx.
Trait Implementations§
Source§impl DeepSizeOf for Row
impl DeepSizeOf for Row
Source§fn deep_size_of_children(&self, context: &mut Context) -> usize
fn deep_size_of_children(&self, context: &mut Context) -> usize
Source§fn deep_size_of(&self) -> usize
fn deep_size_of(&self) -> usize
Source§fn recurse_deep_size_of(&self, context: &mut Context) -> usize
fn recurse_deep_size_of(&self, context: &mut Context) -> usize
std::mem::size_of_val(val) + val.deep_size_of_children() insteadstd::mem::size_of_val(val) + val.deep_size_of_children()Source§impl<'de> Deserialize<'de> for Row
impl<'de> Deserialize<'de> for Row
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>,
impl StructuralPartialEq for Row
Auto Trait Implementations§
impl Freeze for Row
impl RefUnwindSafe for Row
impl Send for Row
impl Sync for Row
impl Unpin for Row
impl UnwindSafe for Row
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more