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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.