pub struct Node<'a> {
pub location: usize,
pub content: NodeContent<'a>,
}
Expand description
Node contains some data, and the location (in the tokenized text) of the first token it used.
Fields§
§location: usize
§content: NodeContent<'a>
Implementations§
Source§impl<'a> Node<'a>
impl<'a> Node<'a>
pub fn new(location: usize, content: NodeContent<'a>) -> Self
pub fn _source(location: usize, source: &'a str) -> Self
pub fn source_from_token(token: &Token<'a>) -> Self
pub fn expression(location: usize, expression: Expression<'a>) -> Self
pub fn assignment( location: usize, name: &'a str, expression: Expression<'a>, ) -> Self
pub fn if_node(location: usize, expression: Expression<'a>) -> Self
pub fn for_node( location: usize, var_name: &'a str, expression: Expression<'a>, ) -> Self
pub fn elif(location: usize, expression: Expression<'a>) -> Self
pub fn else_node(location: usize) -> Self
pub fn end(location: usize) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Node<'a>
impl<'a> RefUnwindSafe for Node<'a>
impl<'a> Send for Node<'a>
impl<'a> Sync for Node<'a>
impl<'a> Unpin for Node<'a>
impl<'a> UnwindSafe for Node<'a>
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