pub struct CompiledSchema { /* private fields */ }Expand description
Immutable compiled schema.
Implementations§
Source§impl CompiledSchema
impl CompiledSchema
Sourcepub fn from_definitions(
definitions: impl IntoIterator<Item = NamespaceDefinition>,
) -> Result<Self, SchemaError>
pub fn from_definitions( definitions: impl IntoIterator<Item = NamespaceDefinition>, ) -> Result<Self, SchemaError>
Creates and validates a compiled schema from typed namespace definitions.
§Errors
Returns SchemaError when definitions are duplicated or expression references cannot be
resolved.
Sourcepub fn definitions(&self) -> &[NamespaceDefinition]
pub fn definitions(&self) -> &[NamespaceDefinition]
Returns all namespace definitions in source order.
Sourcepub fn resolver(&self) -> &SchemaResolver
pub fn resolver(&self) -> &SchemaResolver
Returns the schema resolver.
Sourcepub fn validate_relationship(
&self,
relationship: &Relationship,
) -> Result<(), SchemaError>
pub fn validate_relationship( &self, relationship: &Relationship, ) -> Result<(), SchemaError>
Validates that a relationship references a known resource namespace and relation.
§Errors
Returns SchemaError::RelationNotFound or SchemaError::NamespaceNotFound when the
relationship resource does not match this schema.
Trait Implementations§
Source§impl Clone for CompiledSchema
impl Clone for CompiledSchema
Source§fn clone(&self) -> CompiledSchema
fn clone(&self) -> CompiledSchema
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompiledSchema
impl RefUnwindSafe for CompiledSchema
impl Send for CompiledSchema
impl Sync for CompiledSchema
impl Unpin for CompiledSchema
impl UnsafeUnpin for CompiledSchema
impl UnwindSafe for CompiledSchema
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