pub struct Ident {
pub span: Span,
/* private fields */
}Expand description
Owned equivalent of Ident, with the same API and serialized form.
Fields§
§span: SpanSource range of the identifier token; includes the $ of a variable name.
Implementations§
Source§impl Ident
impl Ident
Sourcepub fn new(name: impl Into<Box<str>>, span: Span) -> Self
pub fn new(name: impl Into<Box<str>>, span: Span) -> Self
Construct an identifier from a non-empty name.
Sourcepub fn as_str(&self) -> Option<&str>
pub fn as_str(&self) -> Option<&str>
Returns Some(s) for a real identifier, None for the error state.
Trait Implementations§
impl Eq for Ident
impl StructuralPartialEq for Ident
Auto Trait Implementations§
impl Freeze for Ident
impl RefUnwindSafe for Ident
impl Send for Ident
impl Sync 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