[][src]Struct rowan::GreenNode

pub struct GreenNode<T: Types>(_);

GreenNode is an immutable syntax tree, which is cheap to update. It lacks parent pointers and information about offsets.

Methods

impl<T: Types> GreenNode<T>
[src]

pub fn new_leaf(kind: T::Kind, text: SmolStr) -> GreenNode<T>
[src]

Creates new leaf green node.

pub fn new_branch(kind: T::Kind, children: Box<[GreenNode<T>]>) -> GreenNode<T>
[src]

Creates new branch green node.

pub fn kind(&self) -> T::Kind
[src]

Kind of this node.

pub fn text_len(&self) -> TextUnit
[src]

Length of the text, covered by this node.

pub fn children(&self) -> &[GreenNode<T>]
[src]

Children of this node, empty for leaves.

pub fn leaf_text(&self) -> Option<&SmolStr>
[src]

Text of this node, if it is a leaf, and None otherwise.

pub fn memory_size_of_subtree(&self) -> usize
[src]

Number of memory bytes of occupied by subtree rooted at self.

Trait Implementations

impl<T: Types> Clone for GreenNode<T>
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Debug + Types> Debug for GreenNode<T>
[src]

Auto Trait Implementations

impl<T> Send for GreenNode<T> where
    <T as Types>::Kind: Send + Sync

impl<T> Sync for GreenNode<T> where
    <T as Types>::Kind: Send + Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Erased for T