Struct syntax::ast::Ident [−][src]
Fields
name: Symbol
span: Span
Methods
impl Ident[src]
impl Identpub const fn new(name: Symbol, span: Span) -> Ident[src]
pub const fn new(name: Symbol, span: Span) -> Identpub const fn with_empty_ctxt(name: Symbol) -> Ident[src]
pub const fn with_empty_ctxt(name: Symbol) -> Identpub fn from_interned_str(string: InternedString) -> Ident[src]
pub fn from_interned_str(string: InternedString) -> IdentMaps an interned string to an identifier with an empty syntax context.
pub fn from_str(string: &str) -> Ident[src]
pub fn from_str(string: &str) -> IdentMaps a string to an identifier with an empty syntax context.
pub fn with_span_pos(self, span: Span) -> Ident[src]
pub fn with_span_pos(self, span: Span) -> IdentReplace lo and hi with those from span, but keep hygiene context.
pub fn without_first_quote(self) -> Ident[src]
pub fn without_first_quote(self) -> Identpub fn modern(self) -> Ident[src]
pub fn modern(self) -> Ident"Normalize" ident for use in comparisons using "item hygiene".
Identifiers with same string value become same if they came from the same "modern" macro
(e.g. macro item, but not macro_rules item) and stay different if they came from
different "modern" macros.
Technically, this operation strips all non-opaque marks from ident's syntactic context.
pub fn modern_and_legacy(self) -> Ident[src]
pub fn modern_and_legacy(self) -> Ident"Normalize" ident for use in comparisons using "local variable hygiene".
Identifiers with same string value become same if they came from the same non-transparent
macro (e.g. macro or macro_rules! items) and stay different if they came from different
non-transparent macros.
Technically, this operation strips all transparent marks from ident's syntactic context.
pub fn gensym(self) -> Ident[src]
pub fn gensym(self) -> Identpub fn as_str(self) -> LocalInternedString[src]
pub fn as_str(self) -> LocalInternedStringpub fn as_interned_str(self) -> InternedString[src]
pub fn as_interned_str(self) -> InternedStringimpl Ident[src]
impl Identpub fn is_special(self) -> bool[src]
pub fn is_special(self) -> boolpub fn is_used_keyword(self) -> bool[src]
pub fn is_used_keyword(self) -> boolReturns true if the token is a keyword used in the language.
pub fn is_unused_keyword(self) -> bool[src]
pub fn is_unused_keyword(self) -> boolReturns true if the token is a keyword reserved for possible future use.
pub fn is_reserved(self) -> bool[src]
pub fn is_reserved(self) -> boolReturns true if the token is either a special identifier or a keyword.
pub fn is_path_segment_keyword(self) -> bool[src]
pub fn is_path_segment_keyword(self) -> boolA keyword or reserved identifier that can be used as a path segment.
pub fn is_raw_guess(self) -> bool[src]
pub fn is_raw_guess(self) -> boolTrait Implementations
impl Hash for Ident[src]
impl Hash for Identfn hash<H>(&self, state: &mut H) where
H: Hasher, [src]
fn hash<H>(&self, state: &mut H) where
H: Hasher, Feeds this value into the given [Hasher]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, Feeds a slice of this type into the given [Hasher]. Read more
impl Display for Ident[src]
impl Display for Identfn fmt(&self, f: &mut Formatter) -> Result<(), Error>[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>Formats the value using the given formatter. Read more
impl Decodable for Ident[src]
impl Decodable for Identimpl Clone for Ident[src]
impl Clone for Identfn clone(&self) -> Ident[src]
fn clone(&self) -> IdentReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Debug for Ident[src]
impl Debug for Identfn fmt(&self, f: &mut Formatter) -> Result<(), Error>[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>Formats the value using the given formatter. Read more
impl Copy for Ident[src]
impl Copy for Identimpl Eq for Ident[src]
impl Eq for Identimpl PartialEq<Ident> for Ident[src]
impl PartialEq<Ident> for Identfn eq(&self, rhs: &Ident) -> bool[src]
fn eq(&self, rhs: &Ident) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
fn ne(&self, other: &Rhs) -> boolThis method tests for !=.
impl Encodable for Ident[src]
impl Encodable for Identimpl ToTokens for Ident[src]
impl ToTokens for Ident