pub struct Catalog { /* private fields */ }Expand description
Logical catalog: a set of TableSchemas keyed by name.
Implementations§
Source§impl Catalog
impl Catalog
Sourcepub fn new(tables: impl IntoIterator<Item = TableSchema>) -> Self
pub fn new(tables: impl IntoIterator<Item = TableSchema>) -> Self
Builds a catalog from an iterator of table schemas.
Sourcepub fn table(&self, name: &str) -> Option<&TableSchema>
pub fn table(&self, name: &str) -> Option<&TableSchema>
Looks up a table by name; None if absent.
Sourcepub fn require_table(&self, name: &str) -> Result<&TableSchema, SqlError>
pub fn require_table(&self, name: &str) -> Result<&TableSchema, SqlError>
Looks up a table by name, returning SqlError::UnknownTable
if absent.
§Errors
SqlError::UnknownTable when the table is not in the catalog.
Sourcepub fn tables(&self) -> impl Iterator<Item = &TableSchema>
pub fn tables(&self) -> impl Iterator<Item = &TableSchema>
Iterates over table schemas in stable (alphabetical) order.
Trait Implementations§
impl Eq for Catalog
impl StructuralPartialEq for Catalog
Auto Trait Implementations§
impl Freeze for Catalog
impl RefUnwindSafe for Catalog
impl Send for Catalog
impl Sync for Catalog
impl Unpin for Catalog
impl UnsafeUnpin for Catalog
impl UnwindSafe for Catalog
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.