hir::tt

Type Alias TokenTree

pub type TokenTree = TokenTree<SpanData<SyntaxContextId>>;

Aliased Type§

enum TokenTree {
    Leaf(Leaf<SpanData<SyntaxContextId>>),
    Subtree(Subtree<SpanData<SyntaxContextId>>),
}

Variants§

§

Leaf(Leaf<SpanData<SyntaxContextId>>)

§

Subtree(Subtree<SpanData<SyntaxContextId>>)

Implementations

§

impl<S> TokenTree<S>
where S: Copy,

pub fn empty(span: S) -> TokenTree<S>

pub fn subtree_or_wrap(self, span: DelimSpan<S>) -> Subtree<S>

pub fn first_span(&self) -> S

Trait Implementations

§

impl<S> Clone for TokenTree<S>
where S: Clone,

§

fn clone(&self) -> TokenTree<S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<S> Debug for TokenTree<S>
where S: Debug,

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<S> Display for TokenTree<S>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl<S> From<Leaf<S>> for TokenTree<S>

§

fn from(it: Leaf<S>) -> TokenTree<S>

Converts to this type from the input type.
§

impl<S> From<Subtree<S>> for TokenTree<S>

§

fn from(it: Subtree<S>) -> TokenTree<S>

Converts to this type from the input type.
§

impl<S> Hash for TokenTree<S>
where S: Hash,

§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl<S> PartialEq for TokenTree<S>
where S: PartialEq,

§

fn eq(&self, other: &TokenTree<S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
§

impl ToTokenTree for TokenTree<SpanData<SyntaxContextId>>

§

fn to_token( self, _: SpanData<SyntaxContextId>, ) -> TokenTree<SpanData<SyntaxContextId>>

§

impl<S> Eq for TokenTree<S>
where S: Eq,

§

impl<S> StructuralPartialEq for TokenTree<S>