pub struct TableSchema {
pub id: String,
pub columns: Vec<TableColumnSchema>,
}Expand description
Parsed table schema JSON.
Fields§
§id: StringStable schema/table id.
columns: Vec<TableColumnSchema>Ordered table columns.
Implementations§
Source§impl TableSchema
impl TableSchema
Sourcepub fn from_package(package: &McdPackage, path: &str) -> Result<Self>
pub fn from_package(package: &McdPackage, path: &str) -> Result<Self>
Parse a table schema from a package entry.
Sourcepub fn columns_by_name(&self) -> IndexMap<&str, &TableColumnSchema>
pub fn columns_by_name(&self) -> IndexMap<&str, &TableColumnSchema>
Return a map keyed by column name.
Sourcepub fn has_column(&self, name: &str) -> bool
pub fn has_column(&self, name: &str) -> bool
Return true when the schema contains a column.
Sourcepub fn column(&self, name: &str) -> Option<&TableColumnSchema>
pub fn column(&self, name: &str) -> Option<&TableColumnSchema>
Find a column by name.
Trait Implementations§
Source§impl Clone for TableSchema
impl Clone for TableSchema
Source§fn clone(&self) -> TableSchema
fn clone(&self) -> TableSchema
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TableSchema
impl Debug for TableSchema
Source§impl<'de> Deserialize<'de> for TableSchema
impl<'de> Deserialize<'de> for TableSchema
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 PartialEq for TableSchema
impl PartialEq for TableSchema
Source§fn eq(&self, other: &TableSchema) -> bool
fn eq(&self, other: &TableSchema) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for TableSchema
impl Serialize for TableSchema
impl Eq for TableSchema
impl StructuralPartialEq for TableSchema
Auto Trait Implementations§
impl Freeze for TableSchema
impl RefUnwindSafe for TableSchema
impl Send for TableSchema
impl Sync for TableSchema
impl Unpin for TableSchema
impl UnsafeUnpin for TableSchema
impl UnwindSafe for TableSchema
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.