Struct tc_table::TableSchema
source · pub struct TableSchema { /* private fields */ }
Expand description
The schema of a Table
.
Implementations§
source§impl TableSchema
impl TableSchema
sourcepub fn new<I: IntoIterator<Item = (Id, Vec<Id>)>>(
primary: IndexSchema,
indices: I
) -> Self
pub fn new<I: IntoIterator<Item = (Id, Vec<Id>)>>(
primary: IndexSchema,
indices: I
) -> Self
Construct a new Table
schema.
sourcepub fn indices(&self) -> &[(Id, Vec<Id>)]
pub fn indices(&self) -> &[(Id, Vec<Id>)]
Return a list of index names and the names of the columns they index.
sourcepub fn primary(&self) -> &IndexSchema
pub fn primary(&self) -> &IndexSchema
Return the IndexSchema
of this TableSchema
’s primary index.
Trait Implementations§
source§impl CastFrom<TableSchema> for Value
impl CastFrom<TableSchema> for Value
source§fn cast_from(schema: TableSchema) -> Self
fn cast_from(schema: TableSchema) -> Self
Cast an instance of
T
into an instance of Self
.source§impl Clone for TableSchema
impl Clone for TableSchema
source§fn clone(&self) -> TableSchema
fn clone(&self) -> TableSchema
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Display for TableSchema
impl Display for TableSchema
source§impl From<IndexSchema> for TableSchema
impl From<IndexSchema> for TableSchema
source§fn from(schema: IndexSchema) -> TableSchema
fn from(schema: IndexSchema) -> TableSchema
Converts to this type from the input type.
source§impl FromStream for TableSchema
impl FromStream for TableSchema
source§impl<'en> IntoStream<'en> for TableSchema
impl<'en> IntoStream<'en> for TableSchema
source§impl PartialEq<TableSchema> for TableSchema
impl PartialEq<TableSchema> for TableSchema
source§fn eq(&self, other: &TableSchema) -> bool
fn eq(&self, other: &TableSchema) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<'en> ToStream<'en> for TableSchema
impl<'en> ToStream<'en> for TableSchema
source§impl TryCastFrom<Value> for TableSchema
impl TryCastFrom<Value> for TableSchema
source§fn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if
value
can be cast into Self
.source§fn opt_cast_from(value: Value) -> Option<TableSchema>
fn opt_cast_from(value: Value) -> Option<TableSchema>
Returns
Some(Self)
if the source value can be cast into Self
, otherwise None
.impl Eq for TableSchema
impl StructuralEq for TableSchema
impl StructuralPartialEq for TableSchema
Auto Trait Implementations§
impl RefUnwindSafe for TableSchema
impl Send for TableSchema
impl Sync for TableSchema
impl Unpin for TableSchema
impl UnwindSafe for TableSchema
Blanket Implementations§
source§impl<F> Match for F
impl<F> Match for F
source§fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
fn matches<T>(&self) -> boolwhere
T: TryCastFrom<Self>,
Returns
true
if self
can be cast into the target type T
.source§impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for Twhere
T: CastFrom<F>,
source§fn can_cast_from(_: &F) -> bool
fn can_cast_from(_: &F) -> bool
Test if
value
can be cast into Self
.source§fn opt_cast_from(f: F) -> Option<T>
fn opt_cast_from(f: F) -> Option<T>
Returns
Some(Self)
if the source value can be cast into Self
, otherwise None
.source§impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for Fwhere
T: TryCastFrom<F>,
source§fn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if
self
can be cast into T
.source§fn opt_cast_into(self) -> Option<T>
fn opt_cast_into(self) -> Option<T>
Returns
Some(T)
if self
can be cast into T
, otherwise None
.