pub struct Schema { /* private fields */ }Expand description
Workspace-scoped vocabulary backing schema validation.
Stored as sorted sets so entity_types() / relationship_types() output
is deterministic — useful when surfacing them in error messages.
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn defaults() -> Self
pub fn defaults() -> Self
Default schema (ARCHITECTURE §5). Used when no STOA.md is on disk
or as the fallback floor for Schema::from_stoa_md.
Sourcepub fn from_stoa_md(text: &str) -> Self
pub fn from_stoa_md(text: &str) -> Self
Build a schema from a STOA.md document. Starts from defaults and
extends with any extra vocabulary mentioned in the file.
The parser is intentionally forgiving — STOA.md is human-edited
markdown, not strict YAML. We scan for fenced-code or bullet-list
entries under “Entity types” / “Relationship types” headings.
Sourcepub fn entity_types(&self) -> Vec<&str>
pub fn entity_types(&self) -> Vec<&str>
Sorted view of the entity-type allow-list.
Sourcepub fn relationship_types(&self) -> Vec<&str>
pub fn relationship_types(&self) -> Vec<&str>
Sorted view of the relationship-type allow-list.
Sourcepub fn allows_entity_type(&self, value: &str) -> bool
pub fn allows_entity_type(&self, value: &str) -> bool
True if value is a recognized entity-type.
Sourcepub fn allows_relationship_type(&self, value: &str) -> bool
pub fn allows_relationship_type(&self, value: &str) -> bool
True if value is a recognized relationship-type.
Sourcepub fn allows_kind(&self, value: &str) -> bool
pub fn allows_kind(&self, value: &str) -> bool
True if value is a recognized page-kind.
Sourcepub fn allows_status(&self, value: &str) -> bool
pub fn allows_status(&self, value: &str) -> bool
True if value is a recognized status.
Trait Implementations§
impl Eq for Schema
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.