pub struct Table {
pub id: TableId,
pub name: String,
pub columns: Vec<Column>,
pub primary_key: PrimaryKey,
pub indices: Vec<Index>,
}Expand description
Fields§
§id: TableIdUniquely identifies a table within the schema.
name: StringName of the table as it appears in the database.
columns: Vec<Column>The table’s columns, in order.
primary_key: PrimaryKeyThe table’s primary key definition.
indices: Vec<Index>Secondary indices on this table.
Implementations§
Source§impl Table
impl Table
Sourcepub fn primary_key_column(&self, i: usize) -> &Column
pub fn primary_key_column(&self, i: usize) -> &Column
Returns the i-th column of this table’s primary key.
§Panics
Panics if i is out of bounds for the primary key column list.
Sourcepub fn primary_key_columns(&self) -> impl ExactSizeIterator<Item = &Column> + '_
pub fn primary_key_columns(&self) -> impl ExactSizeIterator<Item = &Column> + '_
Returns an iterator over the columns that make up this table’s primary key.
Sourcepub fn column(&self, id: impl Into<ColumnId>) -> &Column
pub fn column(&self, id: impl Into<ColumnId>) -> &Column
Returns the column identified by id.
Only the column’s index field is used; the table component is ignored.
§Panics
Panics if the column index is out of bounds.
Sourcepub fn resolve(&self, projection: &Projection) -> &Column
pub fn resolve(&self, projection: &Projection) -> &Column
Resolves a single-step Projection to a column.
§Panics
Panics if the projection is empty or contains more than one step.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Table
impl<'de> Deserialize<'de> for Table
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<'a, T> IntoExprTarget<'a, T> for &'a Table
impl<'a, T> IntoExprTarget<'a, T> for &'a Table
Source§fn into_expr_target(self, _schema: &'a T) -> ExprTarget<'a>
fn into_expr_target(self, _schema: &'a T) -> ExprTarget<'a>
Converts
self into an ExprTarget using the provided schema.Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
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