pub struct Schema { /* private fields */ }
Expand description
A Schema is a collection of zero or more TypeDefinition
s.
Each type may refer to other types within the same schema,
or types imported into this schema from other schemas.
To instantiate a Schema
, see SchemaSystem
.
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn get_imported_type<A: AsRef<str>>(
&self,
name: A,
) -> Option<TypeDefinition>
pub fn get_imported_type<A: AsRef<str>>( &self, name: A, ) -> Option<TypeDefinition>
Returns the requested type, if imported in this schema; otherwise returns None.
Sourcepub fn get_built_in_or_defined_type<A: AsRef<str>>(
&self,
name: A,
) -> Option<TypeDefinition>
pub fn get_built_in_or_defined_type<A: AsRef<str>>( &self, name: A, ) -> Option<TypeDefinition>
Returns the requested type, if present in this schema or a a built in type; otherwise returns None.
Sourcepub fn get_type<A: AsRef<str>>(&self, name: A) -> Option<TypeDefinition>
pub fn get_type<A: AsRef<str>>(&self, name: A) -> Option<TypeDefinition>
Returns the requested type, if present in this schema or a a built in type or imported in the schema; otherwise returns None.
Sourcepub fn get_types(&self) -> SchemaTypeIterator ⓘ
pub fn get_types(&self) -> SchemaTypeIterator ⓘ
Returns an iterator over the types in this schema.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin 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