Type Alias Leaf

Source
pub type Leaf = Leaf<Span>;

Aliased Type§

enum Leaf {
    Literal(Literal<SpanData<SyntaxContext>>),
    Punct(Punct<SpanData<SyntaxContext>>),
    Ident(Ident<SpanData<SyntaxContext>>),
}

Variants§

§

Literal(Literal<SpanData<SyntaxContext>>)

§

Punct(Punct<SpanData<SyntaxContext>>)

§

Ident(Ident<SpanData<SyntaxContext>>)

Implementations

§

impl<S> Leaf<S>

pub fn span(&self) -> &S

Trait Implementations§

Source§

impl ToTokenTree for Leaf

Source§

fn to_tokens(self, _span: Span, builder: &mut TopSubtreeBuilder)

§

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

§

fn clone(&self) -> Leaf<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 Leaf<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 Leaf<S>

§

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

Formats the value using the given formatter. Read more
§

impl<S> From<Ident<S>> for Leaf<S>

§

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

Converts to this type from the input type.
§

impl<S> From<Literal<S>> for Leaf<S>

§

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

Converts to this type from the input type.
§

impl<S> From<Punct<S>> for Leaf<S>

§

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

Converts to this type from the input type.
§

impl<S> Hash for Leaf<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 Leaf<S>
where S: PartialEq,

§

fn eq(&self, other: &Leaf<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<S> Eq for Leaf<S>
where S: Eq,

§

impl<S> StructuralPartialEq for Leaf<S>