pub enum RecordKind {
Card,
Eval,
}Expand description
The two record kinds, as they appear in URLs (/cards, /evals) and in
the type column of the store. Everything that differs between a Card
and an Eval (its schema, its facets, its semantic rules) is keyed on this.
Variants§
Card
A Card: what was measured, how, and what the score was.
Eval
An Eval: the material a Card was measured from.
Implementations§
Source§impl RecordKind
impl RecordKind
Sourcepub const fn schema_id(self) -> &'static str
pub const fn schema_id(self) -> &'static str
The current schema identifier for this kind: the one a producer
should declare. Other identifiers may still be accepted; see
RecordKind::schema_ids.
Sourcepub const fn schema_ids(self) -> &'static [&'static str]
pub const fn schema_ids(self) -> &'static [&'static str]
Every schema identifier the hub accepts for this kind, the current
one (RecordKind::schema_id) first.
Sourcepub fn schema(self) -> Schema
pub fn schema(self) -> Schema
The generated JSON Schema for the current identifier of this kind.
Sourcepub fn schema_for(self, id: &str) -> Option<Schema>
pub fn schema_for(self, id: &str) -> Option<Schema>
The generated JSON Schema for one accepted identifier of this kind,
or None when id is not one of RecordKind::schema_ids. Both
Card identifiers share one document; each Eval major has its own.
Trait Implementations§
Source§impl Clone for RecordKind
impl Clone for RecordKind
impl Copy for RecordKind
Source§impl Debug for RecordKind
impl Debug for RecordKind
Source§impl<'de> Deserialize<'de> for RecordKind
impl<'de> Deserialize<'de> for RecordKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for RecordKind
Source§impl Hash for RecordKind
impl Hash for RecordKind
Source§impl JsonSchema for RecordKind
impl JsonSchema for RecordKind
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more