Struct ra_ap_hir_expand::name::Name [−][src]
pub struct Name(_);
Expand description
Name
is a wrapper around string, which is used in hir for both references
and declarations. In theory, names should also carry hygiene info, but we are
not there yet!
Implementations
A fake name for things missing in the source code.
For example, impl Foo for {}
should be treated as a trait impl for a
type with a missing name. Similarly, struct S { : u32 }
should have a
single field with a missing name.
Ideally, we want a gensym
semantics for missing names – each missing
name is equal only to itself. It’s not clear how to implement this in
salsa though, so we punt on that bit for a moment.
Returns the tuple index this name represents if it is a tuple field.
Returns the text this name represents if it isn’t a tuple field.
Returns the textual representation of this name as a [SmolStr
].
Prefer using this over ToString::to_string
if possible as this conversion is cheaper in
the general case.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Name
impl UnwindSafe for Name
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more