pub struct LangInner<N: NodeTypes> { /* private fields */ }Expand description
Generic language implementation parameterized by node types.
This struct provides a single implementation of LangImpl that works with
any NodeTypes implementation (static or dynamic).
Implementations§
Source§impl LangInner<&'static StaticNodeTypes>
impl LangInner<&'static StaticNodeTypes>
pub fn new_static( name: &str, ts_lang: Language, node_types: &'static StaticNodeTypes, ) -> Self
pub fn node_types(&self) -> &'static StaticNodeTypes
Trait Implementations§
Source§impl<N: NodeTypes + Send + Sync> LangImpl for LangInner<N>
impl<N: NodeTypes + Send + Sync> LangImpl for LangInner<N>
fn name(&self) -> &str
fn resolve_named_node(&self, kind: &str) -> Option<NodeTypeId>
fn resolve_anonymous_node(&self, kind: &str) -> Option<NodeTypeId>
fn resolve_field(&self, name: &str) -> Option<NodeFieldId>
fn all_named_node_kinds(&self) -> Vec<&'static str>
fn all_field_names(&self) -> Vec<&'static str>
fn node_type_name(&self, node_type_id: NodeTypeId) -> Option<&'static str>
fn field_name(&self, field_id: NodeFieldId) -> Option<&'static str>
fn fields_for_node_type(&self, node_type_id: NodeTypeId) -> Vec<&'static str>
fn is_supertype(&self, node_type_id: NodeTypeId) -> bool
fn subtypes(&self, supertype: NodeTypeId) -> &[u16]
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
Auto Trait Implementations§
impl<N> Freeze for LangInner<N>where
N: Freeze,
impl<N> RefUnwindSafe for LangInner<N>where
N: RefUnwindSafe,
impl<N> Send for LangInner<N>where
N: Send,
impl<N> Sync for LangInner<N>where
N: Sync,
impl<N> Unpin for LangInner<N>where
N: Unpin,
impl<N> UnwindSafe for LangInner<N>where
N: 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