Struct debris_hir::identifier::IdentifierPath
source · pub struct IdentifierPath {
idents: Vec<SpannedIdentifier>,
}
Expand description
A list of SpannedIdentifier
s, can be a dotted path
Fields§
§idents: Vec<SpannedIdentifier>
Implementations§
source§impl IdentifierPath
impl IdentifierPath
sourcepub fn new(identifiers: Vec<SpannedIdentifier>) -> Self
pub fn new(identifiers: Vec<SpannedIdentifier>) -> Self
Creates a new IdentifierPath
from the vec of identifiers
pub fn idents(&self) -> &[SpannedIdentifier]
pub fn single_ident(&self) -> Option<&SpannedIdentifier>
pub fn display(&self, ctx: &CompileContext) -> String
pub fn span(&self) -> Span
pub fn span_without_last(&self) -> Option<Span>
pub fn last(&self) -> &SpannedIdentifier
pub fn split_at_last(self) -> (Option<IdentifierPath>, SpannedIdentifier)
pub fn into_inner(self) -> Vec<SpannedIdentifier>
Trait Implementations§
source§impl Clone for IdentifierPath
impl Clone for IdentifierPath
source§fn clone(&self) -> IdentifierPath
fn clone(&self) -> IdentifierPath
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 IdentifierPath
impl Debug for IdentifierPath
source§impl From<SpannedIdentifier> for IdentifierPath
impl From<SpannedIdentifier> for IdentifierPath
source§fn from(span: SpannedIdentifier) -> Self
fn from(span: SpannedIdentifier) -> Self
Converts to this type from the input type.
source§impl Hash for IdentifierPath
impl Hash for IdentifierPath
source§impl PartialEq for IdentifierPath
impl PartialEq for IdentifierPath
source§fn eq(&self, other: &IdentifierPath) -> bool
fn eq(&self, other: &IdentifierPath) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for IdentifierPath
impl StructuralEq for IdentifierPath
impl StructuralPartialEq for IdentifierPath
Auto Trait Implementations§
impl RefUnwindSafe for IdentifierPath
impl Send for IdentifierPath
impl Sync for IdentifierPath
impl Unpin for IdentifierPath
impl UnwindSafe for IdentifierPath
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
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§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,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.