Struct oq3_syntax::GreenNode
source · pub struct GreenNode { /* private fields */ }
Expand description
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) -> GreenNode
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<'a> From<&'a GreenNode> for NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
impl<'a> From<&'a GreenNode> for NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
source§fn from(
node: &'a GreenNode
) -> NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
fn from( node: &'a GreenNode ) -> NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
Converts to this type from the input type.
source§impl From<GreenNode> for NodeOrToken<GreenNode, GreenToken>
impl From<GreenNode> for NodeOrToken<GreenNode, GreenToken>
source§fn from(node: GreenNode) -> NodeOrToken<GreenNode, GreenToken>
fn from(node: GreenNode) -> NodeOrToken<GreenNode, GreenToken>
Converts to this type from the input type.
source§impl PartialEq for GreenNode
impl PartialEq for GreenNode
impl Eq for GreenNode
impl StructuralPartialEq for GreenNode
Auto Trait Implementations§
impl Freeze for GreenNode
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more