Struct GreenNode
pub struct GreenNode { /* private fields */ }
Expand description
Internal node in the immutable tree. It has other nodes and tokens as children.
Implementations§
§impl GreenNode
impl GreenNode
pub 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>§
pub fn kind(&self) -> SyntaxKind
pub fn kind(&self) -> SyntaxKind
Kind of this node.
pub fn children(&self) -> Children<'_>
pub fn children(&self) -> Children<'_>
Children 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§
§impl<'a> From<&'a GreenNode> for NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
impl<'a> From<&'a GreenNode> for NodeOrToken<&'a GreenNodeData, &'a GreenTokenData>
§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.
§impl From<GreenNode> for NodeOrToken<GreenNode, GreenToken>
impl From<GreenNode> for NodeOrToken<GreenNode, GreenToken>
§fn from(node: GreenNode) -> NodeOrToken<GreenNode, GreenToken>
fn from(node: GreenNode) -> NodeOrToken<GreenNode, GreenToken>
Converts to this type from the input type.
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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