pub enum Node<'a, 'b> {
StringLit(&'b StringLit<'a>),
NumberLit(&'b NumberLit<'a>),
BooleanLit(&'b BooleanLit),
Object(&'b Object<'a>),
ObjectProp(&'b ObjectProp<'a>),
Array(&'b Array<'a>),
NullKeyword(&'b NullKeyword),
WordLit(&'b WordLit<'a>),
}
Expand description
Node that can appear in the AST.
Variants§
StringLit(&'b StringLit<'a>)
NumberLit(&'b NumberLit<'a>)
BooleanLit(&'b BooleanLit)
Object(&'b Object<'a>)
ObjectProp(&'b ObjectProp<'a>)
Array(&'b Array<'a>)
NullKeyword(&'b NullKeyword)
WordLit(&'b WordLit<'a>)
Implementations§
Source§impl<'a, 'b> Node<'a, 'b>
impl<'a, 'b> Node<'a, 'b>
pub fn as_string_lit(&self) -> Option<&'b StringLit<'a>>
pub fn as_number_lit(&self) -> Option<&'b NumberLit<'a>>
pub fn as_boolean_lit(&self) -> Option<&'b BooleanLit>
pub fn as_object(&self) -> Option<&'b Object<'a>>
pub fn as_object_prop(&self) -> Option<&'b ObjectProp<'a>>
pub fn as_array(&self) -> Option<&'b Array<'a>>
pub fn as_null_keyword(&self) -> Option<&'b NullKeyword>
pub fn as_word_lit(&self) -> Option<&'b WordLit<'a>>
Trait Implementations§
Source§impl<'a, 'b> From<&'b BooleanLit> for Node<'a, 'b>
impl<'a, 'b> From<&'b BooleanLit> for Node<'a, 'b>
Source§fn from(node: &'b BooleanLit) -> Node<'a, 'b>
fn from(node: &'b BooleanLit) -> Node<'a, 'b>
Converts to this type from the input type.
Source§impl<'a, 'b> From<&'b NullKeyword> for Node<'a, 'b>
impl<'a, 'b> From<&'b NullKeyword> for Node<'a, 'b>
Source§fn from(node: &'b NullKeyword) -> Node<'a, 'b>
fn from(node: &'b NullKeyword) -> Node<'a, 'b>
Converts to this type from the input type.
Source§impl<'a, 'b> From<&'b ObjectProp<'a>> for Node<'a, 'b>
impl<'a, 'b> From<&'b ObjectProp<'a>> for Node<'a, 'b>
Source§fn from(node: &'b ObjectProp<'a>) -> Node<'a, 'b>
fn from(node: &'b ObjectProp<'a>) -> Node<'a, 'b>
Converts to this type from the input type.
Source§impl<'a, 'b> From<&'b ObjectPropName<'a>> for Node<'a, 'b>
impl<'a, 'b> From<&'b ObjectPropName<'a>> for Node<'a, 'b>
Source§fn from(object_prop_name: &'b ObjectPropName<'a>) -> Node<'a, 'b>
fn from(object_prop_name: &'b ObjectPropName<'a>) -> Node<'a, 'b>
Converts to this type from the input type.
impl<'a, 'b> Copy for Node<'a, 'b>
impl<'a, 'b> StructuralPartialEq for Node<'a, 'b>
Auto Trait Implementations§
impl<'a, 'b> Freeze for Node<'a, 'b>
impl<'a, 'b> RefUnwindSafe for Node<'a, 'b>
impl<'a, 'b> Send for Node<'a, 'b>
impl<'a, 'b> Sync for Node<'a, 'b>
impl<'a, 'b> Unpin for Node<'a, 'b>
impl<'a, 'b> UnwindSafe for Node<'a, 'b>
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
)