pub struct StaticNodeTypes { /* private fields */ }Expand description
Compiled node type database with static storage.
All data is statically allocated - no runtime initialization needed. Node lookups use binary search on sorted arrays.
Implementations§
Source§impl StaticNodeTypes
impl StaticNodeTypes
pub const fn new( nodes: &'static [(NodeTypeId, StaticNodeTypeInfo)], extras: &'static [NodeTypeId], root: Option<NodeTypeId>, ) -> Self
Sourcepub fn get(
&self,
node_type_id: NodeTypeId,
) -> Option<&'static StaticNodeTypeInfo>
pub fn get( &self, node_type_id: NodeTypeId, ) -> Option<&'static StaticNodeTypeInfo>
Get info for a node type by ID (binary search).
Sourcepub fn contains(&self, node_type_id: NodeTypeId) -> bool
pub fn contains(&self, node_type_id: NodeTypeId) -> bool
Check if node type exists.
Sourcepub fn field(
&self,
node_type_id: NodeTypeId,
field_id: NodeFieldId,
) -> Option<&'static StaticFieldInfo>
pub fn field( &self, node_type_id: NodeTypeId, field_id: NodeFieldId, ) -> Option<&'static StaticFieldInfo>
Get field info for a node type (binary search for node, then field).
Sourcepub fn children(&self, node_type_id: NodeTypeId) -> Option<StaticChildrenInfo>
pub fn children(&self, node_type_id: NodeTypeId) -> Option<StaticChildrenInfo>
Get children info for a node type.
Sourcepub fn extras(&self) -> &'static [NodeTypeId] ⓘ
pub fn extras(&self) -> &'static [NodeTypeId] ⓘ
Get all extra node type IDs.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter( &self, ) -> impl Iterator<Item = (NodeTypeId, &'static StaticNodeTypeInfo)>
Trait Implementations§
Source§impl Clone for StaticNodeTypes
impl Clone for StaticNodeTypes
Source§fn clone(&self) -> StaticNodeTypes
fn clone(&self) -> StaticNodeTypes
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StaticNodeTypes
impl Debug for StaticNodeTypes
Source§impl NodeTypes for StaticNodeTypes
impl NodeTypes for StaticNodeTypes
fn root(&self) -> Option<NodeTypeId>
fn is_extra(&self, node_type_id: NodeTypeId) -> bool
fn has_field( &self, node_type_id: NodeTypeId, node_field_id: NodeFieldId, ) -> bool
fn field_cardinality( &self, node_type_id: NodeTypeId, node_field_id: NodeFieldId, ) -> Option<Cardinality>
fn valid_field_types( &self, node_type_id: NodeTypeId, node_field_id: NodeFieldId, ) -> &[NodeTypeId] ⓘ
fn is_valid_field_type( &self, node_type_id: NodeTypeId, node_field_id: NodeFieldId, child: NodeTypeId, ) -> bool
fn children_cardinality(&self, node_type_id: NodeTypeId) -> Option<Cardinality>
fn valid_child_types(&self, node_type_id: NodeTypeId) -> &[NodeTypeId] ⓘ
fn is_valid_child_type( &self, node_type_id: NodeTypeId, child: NodeTypeId, ) -> bool
impl Copy for StaticNodeTypes
Auto Trait Implementations§
impl Freeze for StaticNodeTypes
impl RefUnwindSafe for StaticNodeTypes
impl Send for StaticNodeTypes
impl Sync for StaticNodeTypes
impl Unpin for StaticNodeTypes
impl UnwindSafe for StaticNodeTypes
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)