pub struct Schema {
pub fields: Vec<FieldSpec>,
pub unique_keys: Vec<Vec<String>>,
pub summary_template: Option<String>,
}Expand description
A user-declared type schema parsed from a DB.md ### <type> sub-section.
The store’s ## Schemas is the only source of schema enforcement — the
toolkit ships no built-in or implicit per-type schema (see SPEC § Schemas).
Fields§
§fields: Vec<FieldSpec>One FieldSpec per bulleted field line, in source order.
unique_keys: Vec<Vec<String>>- unique: <field>[, <field> …] directives — each inner vec is one
uniqueness constraint over the listed field(s) (compound when >1). Two
records of this type whose listed values collide warn as
DUP_UNIQUE_KEY.
summary_template: Option<String>- summary_template: <template> directive — the {field} interpolation
pattern dbmd fm init / dbmd write use to compose a default summary
for this type. None falls back to the body’s first paragraph.
Trait Implementations§
impl StructuralPartialEq for Schema
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnsafeUnpin for Schema
impl UnwindSafe for Schema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more