pub struct Schema { /* private fields */ }Expand description
Validated executable schema. It is never reconstructed from stored data. Clones share the admitted entity roster and named definitions; each open still validates the current durable manifest independently. Revision reads and writes validate the affected counters when used, without caching them.
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn new(entities: &[&'static EntitySchema]) -> Result<Self, Error>
pub fn new(entities: &[&'static EntitySchema]) -> Result<Self, Error>
Validate one bounded compiled schema and compute its canonical fingerprint.
§Errors
Refuses duplicate/invalid identities, fields, keys, indexes or capacity.
Sourcepub const fn fingerprint(&self) -> [u8; 32]
pub const fn fingerprint(&self) -> [u8; 32]
Full domain-separated contract identity used by the durable manifest.
Sourcepub fn entities(&self) -> &[&'static EntitySchema]
pub fn entities(&self) -> &[&'static EntitySchema]
Compiled entities in logical-name order, for bounded inspection.
Sourcepub fn describe(
&self,
selected: Option<&str>,
) -> Result<SchemaDescription<'_>, Error>
pub fn describe( &self, selected: Option<&str>, ) -> Result<SchemaDescription<'_>, Error>
Describe the compiled schema without opening storage. A selected entity includes its reachable named values. References identify other entities without expanding them. Schema admission bounds the entities and definitions.
§Errors
Returns UnknownEntity for an unknown name or a schema error if a type
resolver fails to reproduce its admitted declaration.
Sourcepub fn types(&self) -> impl Iterator<Item = &'static TypeSchema> + '_
pub fn types(&self) -> impl Iterator<Item = &'static TypeSchema> + '_
Reachable named definitions in logical-name order, without expanding cycles.