Struct ludtwig_parser::syntax::untyped::GreenNode
source · #[repr(transparent)]pub struct GreenNode { /* private fields */ }Expand description
GreenNode is an immutable tree, which is cheap to change,
but doesn’t contain offsets and parent pointers.
Internal node in the immutable tree.
It has other nodes and tokens as children.
Implementations§
source§impl GreenNode
impl GreenNode
sourcepub fn new<I>(kind: SyntaxKind, children: I) -> GreenNodewhere
I: IntoIterator<Item = NodeOrToken<GreenNode, GreenToken>>,
<I as IntoIterator>::IntoIter: ExactSizeIterator,
pub fn new<I>(kind: SyntaxKind, children: I) -> GreenNodewhere I: IntoIterator<Item = NodeOrToken<GreenNode, GreenToken>>, <I as IntoIterator>::IntoIter: ExactSizeIterator,
Creates new Node.
Methods from Deref<Target = GreenNodeData>§
sourcepub fn kind(&self) -> SyntaxKind
pub fn kind(&self) -> SyntaxKind
Kind of this node.
pub fn replace_child( &self, index: usize, new_child: NodeOrToken<GreenNode, GreenToken> ) -> GreenNode
pub fn insert_child( &self, index: usize, new_child: NodeOrToken<GreenNode, GreenToken> ) -> GreenNode
pub fn remove_child(&self, index: usize) -> GreenNode
pub fn splice_children<R, I>(&self, range: R, replace_with: I) -> GreenNodewhere R: RangeBounds<usize>, I: IntoIterator<Item = NodeOrToken<GreenNode, GreenToken>>,
Trait Implementations§
source§impl Borrow<GreenNodeData> for GreenNode
impl Borrow<GreenNodeData> for GreenNode
source§fn borrow(&self) -> &GreenNodeData
fn borrow(&self) -> &GreenNodeData
Immutably borrows from an owned value. Read more
source§impl Deref for GreenNode
impl Deref for GreenNode
§type Target = GreenNodeData
type Target = GreenNodeData
The resulting type after dereferencing.
source§fn deref(&self) -> &GreenNodeData
fn deref(&self) -> &GreenNodeData
Dereferences the value.
source§impl PartialEq<GreenNode> for GreenNode
impl PartialEq<GreenNode> for GreenNode
impl Eq for GreenNode
impl StructuralEq for GreenNode
impl StructuralPartialEq for GreenNode
Auto Trait Implementations§
impl RefUnwindSafe for GreenNode
impl Send for GreenNode
impl Sync for GreenNode
impl Unpin for GreenNode
impl UnwindSafe for GreenNode
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