Struct syntax::ast::IdentUnstable [-] [+] [src]

pub struct Ident {
    pub name: Name,
    pub ctxt: SyntaxContext,
}

An identifier contains a Name (index into the interner table) and a SyntaxContext to track renaming and macro expansion per Flatt et al., "Macros That Work Together"

Fields

name
ctxt

Methods

impl Ident

fn new(name: Name) -> Ident

Construct an identifier with the given name and an empty context:

fn as_str<'a>(&'a self) -> &'a str

fn encode_with_hygiene(&self) -> String

Trait Implementations

impl Debug for Ident

fn fmt(&self, f: &mut Formatter) -> Result

impl Display for Ident

fn fmt(&self, f: &mut Formatter) -> Result

impl PartialEq for Ident

fn eq(&self, other: &Ident) -> bool

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

impl Encodable for Ident

fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), Error>

impl Decodable for Ident

fn decode<D: Decoder>(d: &mut D) -> Result<Ident, Error>

impl ToSource for Ident

fn to_source(&self) -> String

impl ToTokens for Ident

fn to_tokens(&self, cx: &ExtCtxt) -> Vec<TokenTree>

Derived Implementations

impl Ord for Ident

fn cmp(&self, __arg_0: &Ident) -> Ordering

impl Eq for Ident

fn assert_receiver_is_total_eq(&self)

impl PartialOrd for Ident

fn partial_cmp(&self, __arg_0: &Ident) -> Option<Ordering>

fn lt(&self, __arg_0: &Ident) -> bool

fn le(&self, __arg_0: &Ident) -> bool

fn gt(&self, __arg_0: &Ident) -> bool

fn ge(&self, __arg_0: &Ident) -> bool

impl Hash for Ident

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

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

impl Copy for Ident

impl Clone for Ident

fn clone(&self) -> Ident

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