Type Alias Pointer

Source
pub type Pointer<T> = Rc<T>;
Expand description

The main pointer used in the Cst. It’s just Rc (or Arc if “async” feature is enabled).

The only reason this type exists is to allow easily switching to other pointer types, by only editing one line instead of mass refactoring, and without breaking crates that use it.

Aliased Type§

pub struct Pointer<T> { /* private fields */ }

Trait Implementations§

Source§

impl<T: GetRange> GetRange for Pointer<T>

Source§

fn get_range(&self) -> Result<Range, GetRangeError>

Get the range of the node. Read more
Source§

impl<T: Parse> Parse for Pointer<T>

Source§

fn parse( token: Token, lexer: &mut Lexer, errors: &mut Vec<Error>, ) -> Option<Self>

Try parsing the current item, starting from the passed token.
Source§

impl<T: Print> Print for Pointer<T>

Source§

fn print(&self) -> String

Prints the whole token including all surrounding trivia.
Source§

fn print_final_trivia(&self) -> String

Prints only the very final trivia. Used for the default implementation of Print::print, which just joins Print::print_without_final_trivia and this function.
Source§

fn print_without_final_trivia(&self) -> String

Prints the whole token including all surrounding trivia, excluding the very last trailing trivia.
Source§

impl<T: TryParse + Parse> TryParse for Pointer<T>

Source§

fn try_parse(lexer: &mut Lexer, errors: &mut Vec<Error>) -> Option<Self>

Try parsing and reset the lexer’s state upon failure.