pub trait Schema: Eq + Send + Sync + Sized + Debug {
type Id: Hash + Eq + Clone + Send + Sync + Debug + Display + 'static;
type Error: Error + From<Error>;
type Value: Clone + Eq + Send + Sync + Debug + 'static;
type Index: IndexSchema<Error = Self::Error, Id = Self::Id, Value = Self::Value> + Send + Sync + 'static;
// Required methods
fn key(&self) -> &[Self::Id];
fn values(&self) -> &[Self::Id];
fn primary(&self) -> &Self::Index;
fn auxiliary(&self) -> &[(String, Self::Index)];
fn validate_key(
&self,
key: Vec<Self::Value>
) -> Result<Vec<Self::Value>, Self::Error>;
fn validate_values(
&self,
values: Vec<Self::Value>
) -> Result<Vec<Self::Value>, Self::Error>;
}
Expand description
The schema of a [Table
]
Required Associated Types§
sourcetype Id: Hash + Eq + Clone + Send + Sync + Debug + Display + 'static
type Id: Hash + Eq + Clone + Send + Sync + Debug + Display + 'static
The type of human-readable identifier used by columns and indices in this Schema
Required Methods§
sourcefn auxiliary(&self) -> &[(String, Self::Index)]
fn auxiliary(&self) -> &[(String, Self::Index)]
Borrow the schemata of the auxiliary indices.
This is ordered so that the first index which matches a given Range
will be used.
Object Safety§
This trait is not object safe.