pub struct Schema { /* private fields */ }
Expand description
Schema with a bimap to allow easy name <-> index retrieval
Implementations§
Source§impl Schema
impl Schema
pub fn new( column_data_types: Vec<DataType>, column_name_to_index: BiMap<String, usize>, ) -> Self
Sourcepub fn get_column_count(&self) -> usize
pub fn get_column_count(&self) -> usize
Returns how many columns in the Table
Sourcepub fn get_column_name(&self, column_index: usize) -> Result<&str>
pub fn get_column_name(&self, column_index: usize) -> Result<&str>
Returns column name given a column index
Sourcepub fn get_column_index(&self, column_name: &str) -> Result<usize>
pub fn get_column_index(&self, column_name: &str) -> Result<usize>
Returns column index given a column name
Sourcepub fn get_column_data_type(&self, column_index: usize) -> Result<DataType>
pub fn get_column_data_type(&self, column_index: usize) -> Result<DataType>
Returns column data type given a column index
Sourcepub fn get_column_data_type_by_name(
&self,
column_name: &str,
) -> Result<DataType>
pub fn get_column_data_type_by_name( &self, column_name: &str, ) -> Result<DataType>
Returns column data type given a column index
Sourcepub fn get_colum_data_types(&self) -> &[DataType]
pub fn get_colum_data_types(&self) -> &[DataType]
Returns column data types
Sourcepub fn get_column_name_to_index_map(&self) -> &BiMap<String, usize>
pub fn get_column_name_to_index_map(&self) -> &BiMap<String, usize>
Returns column data types
pub fn into_data_types_and_name_to_index_map( self, ) -> (Vec<DataType>, BiMap<String, usize>)
Trait Implementations§
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 Eq for Schema
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.