pub struct Metamodel { /* private fields */ }Expand description
Kinds of a model. Ids 0..15 are the archetypes’ default kinds
(KindId::of); finer kinds are defined after them, by name.
Implementations§
Source§impl Metamodel
impl Metamodel
Sourcepub fn define(
&mut self,
name: &str,
archetype: EntityKind,
traits: TraitMask,
fm3: Option<&str>,
) -> KindId
pub fn define( &mut self, name: &str, archetype: EntityKind, traits: TraitMask, fm3: Option<&str>, ) -> KindId
Kind named name, defined with archetype if absent (an existing
kind is left as is). A full table (256 kinds) falls back to the
archetype’s default kind, so extraction never fails on it.
Sourcepub fn set_traits(&mut self, id: KindId, traits: TraitMask) -> bool
pub fn set_traits(&mut self, id: KindId, traits: TraitMask) -> bool
Sets the trait mask of an existing kind (how a frontend gives the default archetype kinds their traits). Returns false for an unknown id.
Sourcepub fn set_concept(
&mut self,
id: KindId,
graphql_type: Option<&str>,
graphql_root: Option<&str>,
) -> bool
pub fn set_concept( &mut self, id: KindId, graphql_type: Option<&str>, graphql_root: Option<&str>, ) -> bool
Declares the GraphQL concept name and root field of a kind defined beyond the archetypes’ defaults (those keep the archetype types). Returns false for an archetype default or an unknown id.
pub fn find(&self, name: &str) -> Option<KindId>
pub fn get(&self, id: KindId) -> Option<&KindInfo>
Sourcepub fn archetype(&self, id: KindId) -> EntityKind
pub fn archetype(&self, id: KindId) -> EntityKind
Archetype of id; kinds of another model fall back to Variable.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn iter(&self) -> impl ExactSizeIterator<Item = (KindId, &KindInfo)>
pub fn iter(&self) -> impl ExactSizeIterator<Item = (KindId, &KindInfo)>
Every kind with its id, archetype defaults first.
Trait Implementations§
impl Eq for Metamodel
impl StructuralPartialEq for Metamodel
Auto Trait Implementations§
impl Forget for Metamodel
impl Freeze for Metamodel
impl Move for Metamodel
impl RefUnwindSafe for Metamodel
impl Send for Metamodelwhere
RawVecInner: Send,
impl Sync for Metamodelwhere
RawVecInner: Sync,
impl Unpin for Metamodel
impl UnsafeUnpin for Metamodel
impl UnwindSafe for Metamodelwhere
RawVecInner: UnwindSafe,
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