pub struct StructureRegistry { /* private fields */ }Expand description
Registry of structure types and their fields.
Implementations§
Source§impl StructureRegistry
impl StructureRegistry
Sourcepub fn register(
&mut self,
name: impl Into<String>,
ctor_name: impl Into<String>,
fields: Vec<FieldDescriptor>,
)
pub fn register( &mut self, name: impl Into<String>, ctor_name: impl Into<String>, fields: Vec<FieldDescriptor>, )
Register a new structure type.
Sourcepub fn find(&self, name: &str) -> Option<&StructureDef>
pub fn find(&self, name: &str) -> Option<&StructureDef>
Look up a structure by name.
Sourcepub fn field_count(&self, name: &str) -> usize
pub fn field_count(&self, name: &str) -> usize
Return the field count for a named structure, or 0 if unknown.
Sourcepub fn has_prop_fields(&self, name: &str) -> bool
pub fn has_prop_fields(&self, name: &str) -> bool
Return whether a named structure has any Prop fields.
Sourcepub fn projectors(&self, name: &str) -> Vec<String>
pub fn projectors(&self, name: &str) -> Vec<String>
Return projector names for a structure.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StructureRegistry
impl RefUnwindSafe for StructureRegistry
impl Send for StructureRegistry
impl Sync for StructureRegistry
impl Unpin for StructureRegistry
impl UnsafeUnpin for StructureRegistry
impl UnwindSafe for StructureRegistry
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