pub struct Schema {
pub schema: Vec<DataType>,
pub col_names: HashMap<String, usize>,
}Expand description
Represents a Schema of a data frame
Fields§
§schema: Vec<DataType>The DataTypes of this Schema
col_names: HashMap<String, usize>A reverse column name to column index map for all the named columns. Helps getting the index by column name faster.
Implementations§
Source§impl Schema
The implementation of the Schema interface, which manages data types and
row/column names of local and distributed data frames.
impl Schema
The implementation of the Schema interface, which manages data types and
row/column names of local and distributed data frames.
Sourcepub fn add_column(
&mut self,
data_type: DataType,
col_name: Option<String>,
) -> Result<(), LiquidError>
pub fn add_column( &mut self, data_type: DataType, col_name: Option<String>, ) -> Result<(), LiquidError>
Add a column with the given data_type, with an optional column name,
to this Schema. Column names must be unique. If col_name is Some
and the name already exists in this Schema, the column will not
be added to this Schema and a LiquidError::NameAlreadyExists error
will be returned.
Sourcepub fn col_type(&self, idx: usize) -> Result<&DataType, LiquidError>
pub fn col_type(&self, idx: usize) -> Result<&DataType, LiquidError>
Get the data type of the column at the given idx
Returns a result that will Error if the idx is out of bounds.
Trait Implementations§
Source§impl DeepSizeOf for Schema
impl DeepSizeOf for Schema
Source§fn deep_size_of_children(&self, context: &mut Context) -> usize
fn deep_size_of_children(&self, context: &mut Context) -> usize
Returns an estimation of the heap-managed storage of this object.
This does not include the size of the object itself. Read more
Source§fn deep_size_of(&self) -> usize
fn deep_size_of(&self) -> usize
Returns an estimation of a total size of memory owned by the
object, including heap-managed storage. Read more
Source§fn recurse_deep_size_of(&self, context: &mut Context) -> usize
fn recurse_deep_size_of(&self, context: &mut Context) -> usize
👎Deprecated since 0.1.1: use
std::mem::size_of_val(val) + val.deep_size_of_children() insteadDeprecated: equivalent to
std::mem::size_of_val(val) + val.deep_size_of_children()Source§impl<'de> Deserialize<'de> for Schema
impl<'de> Deserialize<'de> for Schema
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
impl StructuralPartialEq for Schema
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnwindSafe for Schema
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§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>
Converts
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>
Converts
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