pub struct Column { /* private fields */ }Expand description
One column of a table.
Implementations§
Source§impl Column
impl Column
Sourcepub fn new(name: impl Into<String>, column_type: ColumnType) -> Self
pub fn new(name: impl Into<String>, column_type: ColumnType) -> Self
A column that may be missing or #.
Sourcepub fn required(self) -> Self
pub fn required(self) -> Self
Marks the column as one every row must have.
A required column is what i64 means and an optional one is what
Option<i64> means: the cluster rejects a row that leaves a required
column out.
Sourcepub fn key(self) -> Self
pub fn key(self) -> Self
Makes this an ascending key column.
Key columns must be the first columns of the schema, in order: the
cluster refuses a schema whose keys are not a prefix with
Key columns must form a prefix of schema.
Sourcepub fn sorted(self, order: SortOrder) -> Self
pub fn sorted(self, order: SortOrder) -> Self
Makes this a key column, sorted the given way.
See SortOrder::Descending before reaching for anything but
ascending.
Sourcepub fn column_type(&self) -> ColumnType
pub fn column_type(&self) -> ColumnType
The column’s type.
Sourcepub fn is_required(&self) -> bool
pub fn is_required(&self) -> bool
Whether every row must carry it.
Sourcepub fn sort_order(&self) -> Option<SortOrder>
pub fn sort_order(&self) -> Option<SortOrder>
Its sort order, if it is a key column.
Trait Implementations§
impl Eq for Column
impl StructuralPartialEq for Column
Auto Trait Implementations§
impl Freeze for Column
impl RefUnwindSafe for Column
impl Send for Column
impl Sync for Column
impl Unpin for Column
impl UnsafeUnpin for Column
impl UnwindSafe for Column
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