pub struct Ident { /* private fields */ }Expand description
A Rust identifier token, including its source span and raw-identifier form.
Implementations§
Source§impl Ident
impl Ident
pub fn new(text: impl Display) -> Ident
pub fn lex(input: impl Display) -> Result<Ident, LexError>
pub fn with_span(self, span: Span) -> Ident
pub fn text(&self) -> &str
pub fn is_raw(&self) -> bool
pub fn span(&self) -> Span
pub fn set_span(&mut self, span: Span)
pub fn to_lowercase(self) -> Ident
pub fn to_uppercase(self) -> Ident
pub fn to_pascal_case(&self) -> Ident
pub fn to_snake_case(&self) -> Ident
pub fn to_token_tree(&self) -> TokenTree
pub fn into_token_tree(self) -> TokenTree
Trait Implementations§
impl Eq for Ident
Source§impl Serialize for Ident
Available on crate feature serde only.
impl Serialize for Ident
Available on crate feature
serde only.Source§fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
s: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Ident
Auto Trait Implementations§
impl !Send for Ident
impl !Sync for Ident
impl Forget for Ident
impl Freeze for Ident
impl RefUnwindSafe for Ident
impl Unpin for Ident
impl UnsafeUnpin for Ident
impl UnwindSafe for Ident
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more