pub struct Schema {
pub types: BTreeMap<TypeName, SchemaType>,
}Expand description
A whole schema: every declared type, keyed by qualified name.
Fields§
§types: BTreeMap<TypeName, SchemaType>The declared types, keyed by their qualified TypeName.
Implementations§
Source§impl Schema
impl Schema
Sourcepub fn get(&self, name: &TypeName) -> Option<&SchemaType>
pub fn get(&self, name: &TypeName) -> Option<&SchemaType>
Look up a type by qualified name.
Sourcepub fn upsert_all(&mut self, types: impl IntoIterator<Item = SchemaType>)
pub fn upsert_all(&mut self, types: impl IntoIterator<Item = SchemaType>)
Insert (replacing on conflict) a list of SchemaTypes.
Sourcepub fn relation_names(&self) -> Vec<&str>
pub fn relation_names(&self) -> Vec<&str>
All declared relation names that resolve to a real SPG type (i.e. not BASIC/STANDARD value-typed properties). Used by the planner.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Schema
impl<'de> Deserialize<'de> for Schema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more