Struct paralegal_spdg::Identifier
source · pub struct Identifier(pub(crate) Intern<String>);
Expand description
An identifier for any kind of object (functions, markers, etc.).
Implemented as an interned string, so identifiers are cheap to reuse.
Tuple Fields§
§0: Intern<String>
Implementations§
source§impl Identifier
impl Identifier
sourcepub fn new(s: Symbol) -> Self
pub fn new(s: Symbol) -> Self
Intern a new identifier from a rustc rustc::span::Symbol
sourcepub fn new_intern(s: &str) -> Self
pub fn new_intern(s: &str) -> Self
Interns the input string into an identifier.
Note: this requires locking the global intern arena. See internment::Intern
for details.
Trait Implementations§
source§impl Clone for Identifier
impl Clone for Identifier
source§fn clone(&self) -> Identifier
fn clone(&self) -> Identifier
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Identifier
impl Debug for Identifier
source§impl<'de> Deserialize<'de> for Identifier
impl<'de> Deserialize<'de> for Identifier
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Display for Identifier
impl Display for Identifier
source§impl Hash for Identifier
impl Hash for Identifier
source§impl Ord for Identifier
impl Ord for Identifier
source§fn cmp(&self, other: &Identifier) -> Ordering
fn cmp(&self, other: &Identifier) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq<Identifier> for Identifier
impl PartialEq<Identifier> for Identifier
source§fn eq(&self, other: &Identifier) -> bool
fn eq(&self, other: &Identifier) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<Identifier> for Identifier
impl PartialOrd<Identifier> for Identifier
source§fn partial_cmp(&self, other: &Identifier) -> Option<Ordering>
fn partial_cmp(&self, other: &Identifier) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Identifier
impl Serialize for Identifier
impl Copy for Identifier
impl Eq for Identifier
impl StructuralEq for Identifier
impl StructuralPartialEq for Identifier
Auto Trait Implementations§
impl RefUnwindSafe for Identifier
impl Send for Identifier
impl Sync for Identifier
impl Unpin for Identifier
impl UnwindSafe for Identifier
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.