Trait dprint_swc_ext::common::RootNode

source ·
pub trait RootNode<'a> {
    // Required methods
    fn maybe_text_info(&self) -> Option<&'a SourceTextInfo>;
    fn maybe_token_container(&self) -> Option<&'a TokenContainer<'a>>;
    fn maybe_comment_container(&self) -> Option<&'a CommentContainer<'a>>;

    // Provided methods
    fn token_at_index(&self, index: usize) -> Option<&'a TokenAndSpan> { ... }
    fn token_container(&self) -> &'a TokenContainer<'a> { ... }
    fn comment_container(&self) -> &'a CommentContainer<'a> { ... }
}
Expand description

A Module or Script node.

Required Methods§

Provided Methods§

Implementors§

source§

impl<'a> RootNode<'a> for &Module<'a>

source§

impl<'a> RootNode<'a> for &Script<'a>

source§

impl<'a> RootNode<'a> for Program<'a>

source§

impl<'a> RootNode<'a> for Module<'a>

source§

impl<'a> RootNode<'a> for Script<'a>