Struct tc_table::IndexSchema
source · [−]pub struct IndexSchema { /* private fields */ }
Expand description
The schema of a Table
index
Implementations
sourceimpl IndexSchema
impl IndexSchema
sourcepub fn columns(&self) -> Vec<Column>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn columns(&self) -> Vec<Column>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Return a list of the columns in this schema.
sourcepub fn column_names(&self) -> impl Iterator<Item = &Id>
pub fn column_names(&self) -> impl Iterator<Item = &Id>
Iterate over the names of the columns in this schema.
sourcepub fn key_values_from_row(
&self,
row: Row,
reject_extras: bool
) -> TCResult<(Key, Values)>
pub fn key_values_from_row(
&self,
row: Row,
reject_extras: bool
) -> TCResult<(Key, Values)>
Given a Row
, return a (key, values)
tuple.
sourcepub fn key_values_from_tuple(
&self,
tuple: Tuple<Value>
) -> TCResult<(Vec<Value>, Vec<Value>)>
pub fn key_values_from_tuple(
&self,
tuple: Tuple<Value>
) -> TCResult<(Vec<Value>, Vec<Value>)>
Given a Row
, return a (key, values)
tuple.
sourcepub fn row_from_key_values(&self, key: Key, values: Values) -> TCResult<Row>
pub fn row_from_key_values(&self, key: Key, values: Values) -> TCResult<Row>
Given a key
and values
, return a Row
.
sourcepub fn row_from_values(&self, values: Values) -> TCResult<Row>
pub fn row_from_values(&self, values: Values) -> TCResult<Row>
Given a list of Value
s, return a Row
.
sourcepub fn starts_with(&self, expected: &[Id]) -> bool
pub fn starts_with(&self, expected: &[Id]) -> bool
Return true
if this schema starts with the given slice of column names.
sourcepub fn auxiliary(&self, key: &[Id]) -> TCResult<IndexSchema>
pub fn auxiliary(&self, key: &[Id]) -> TCResult<IndexSchema>
Return the IndexSchema
needed to index the given columns.
sourcepub fn validate_columns(&self, columns: &[Id]) -> TCResult<()>
pub fn validate_columns(&self, columns: &[Id]) -> TCResult<()>
Return an error if this schema does not support ordering by the given columns.
sourcepub fn validate_key(&self, key: Key) -> TCResult<Key>
pub fn validate_key(&self, key: Key) -> TCResult<Key>
Return an error if the given key does not match this schema.
sourcepub fn validate_values(&self, values: Values) -> TCResult<Key>
pub fn validate_values(&self, values: Values) -> TCResult<Key>
Return an error if the given values do not match this schema.
sourcepub fn validate_row_partial(&self, row: Row) -> TCResult<Row>
pub fn validate_row_partial(&self, row: Row) -> TCResult<Row>
Return an error if the given Row
has any extra fields or incompatible values.
Trait Implementations
sourceimpl CastFrom<IndexSchema> for Value
impl CastFrom<IndexSchema> for Value
sourcefn cast_from(schema: IndexSchema) -> Self
fn cast_from(schema: IndexSchema) -> Self
Cast an instance of T
into an instance of Self
.
sourceimpl Clone for IndexSchema
impl Clone for IndexSchema
sourcefn clone(&self) -> IndexSchema
fn clone(&self) -> IndexSchema
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Display for IndexSchema
impl Display for IndexSchema
sourceimpl From<IndexSchema> for Map<Column>
impl From<IndexSchema> for Map<Column>
sourcefn from(schema: IndexSchema) -> Map<Column>
fn from(schema: IndexSchema) -> Map<Column>
Converts to this type from the input type.
sourceimpl From<IndexSchema> for RowSchema
impl From<IndexSchema> for RowSchema
sourcefn from(schema: IndexSchema) -> RowSchema
fn from(schema: IndexSchema) -> RowSchema
Converts to this type from the input type.
sourceimpl From<IndexSchema> for TableSchema
impl From<IndexSchema> for TableSchema
sourcefn from(schema: IndexSchema) -> TableSchema
fn from(schema: IndexSchema) -> TableSchema
Converts to this type from the input type.
sourceimpl FromStream for IndexSchema
impl FromStream for IndexSchema
sourceimpl<'en> IntoStream<'en> for IndexSchema
impl<'en> IntoStream<'en> for IndexSchema
sourceimpl PartialEq<IndexSchema> for IndexSchema
impl PartialEq<IndexSchema> for IndexSchema
sourcefn eq(&self, other: &IndexSchema) -> bool
fn eq(&self, other: &IndexSchema) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &IndexSchema) -> bool
fn ne(&self, other: &IndexSchema) -> bool
This method tests for !=
.
sourceimpl TryCastFrom<Value> for IndexSchema
impl TryCastFrom<Value> for IndexSchema
sourcefn can_cast_from(value: &Value) -> bool
fn can_cast_from(value: &Value) -> bool
Test if value
can be cast into Self
.
sourcefn opt_cast_from(value: Value) -> Option<IndexSchema>
fn opt_cast_from(value: Value) -> Option<IndexSchema>
Returns Some(Self)
if the source value can be cast into Self
, otherwise None
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
impl Eq for IndexSchema
impl StructuralEq for IndexSchema
impl StructuralPartialEq for IndexSchema
Auto Trait Implementations
impl RefUnwindSafe for IndexSchema
impl Send for IndexSchema
impl Sync for IndexSchema
impl Unpin for IndexSchema
impl UnwindSafe for IndexSchema
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<F> Match for F
impl<F> Match for F
sourcefn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
fn matches<T>(&self) -> bool where
T: TryCastFrom<Self>,
Returns true
if self
can be cast into the target type T
.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
impl<F, T> TryCastFrom<F> for T where
T: CastFrom<F>,
sourcefn can_cast_from(&F) -> bool
fn can_cast_from(&F) -> bool
Test if value
can be cast into Self
.
sourcefn 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
.
sourcefn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
fn try_cast_from<Err, OnErr>(value: T, on_err: OnErr) -> Result<Self, Err> where
OnErr: FnOnce(&T) -> Err,
Returns Ok(Self)
if the source value can be cast into Self
, otherwise calls on_err
.
sourceimpl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
impl<F, T> TryCastInto<T> for F where
T: TryCastFrom<F>,
sourcefn can_cast_into(&self) -> bool
fn can_cast_into(&self) -> bool
Test if self
can be cast into T
.
sourcefn 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
.
sourcefn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
fn try_cast_into<Err, OnErr>(self, on_err: OnErr) -> Result<T, Err> where
OnErr: FnOnce(&Self) -> Err,
Returns Ok(T)
if self
can be cast into T
, otherwise calls on_err
.