pub struct Ident {
pub data: Symbol,
pub range: Range,
pub generated: bool,
}
Expand description
Identifier inside a syntax context.
Fields§
§data: Symbol
§range: Range
§generated: bool
Implementations§
Source§impl Ident
impl Ident
pub fn new(data: String, range: Range) -> Ident
pub fn new_static(data: &str, range: Range) -> Ident
pub fn new_by_sugar(data: &str, range: Range) -> Ident
pub fn with_name(&self, f: fn(String) -> String) -> Ident
pub fn add_underscore(&self) -> Ident
pub fn to_str(&self) -> &str
pub fn to_generated(&self) -> Self
pub fn to_qualified_ident(&self) -> QualifiedIdent
pub fn decode(num: u64) -> String
pub fn encode(&self) -> u64
Sourcepub fn set_ctx(&self, ctx: SyntaxCtxIndex) -> Ident
pub fn set_ctx(&self, ctx: SyntaxCtxIndex) -> Ident
Changes the syntax context of the range and of the ident
pub fn add_segment(&self, name: &str) -> Ident
pub fn generate(data: &str) -> Ident
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 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