Fields§
§kind: PathKind
§segments: Vec<Name>
Implementations§
source§impl Path
impl Path
sourcepub fn from_name_ref(name_ref: &NameRef) -> Path
pub fn from_name_ref(name_ref: &NameRef) -> Path
Converts an ast::NameRef
into a single-identifier Path
.
sourcepub fn as_ident(&self) -> Option<&Name>
pub fn as_ident(&self) -> Option<&Name>
If this path represents a single identifier, like foo
, return its name.
sourcepub fn from_segments(
kind: PathKind,
segments: impl IntoIterator<Item = Name>
) -> Path
pub fn from_segments(
kind: PathKind,
segments: impl IntoIterator<Item = Name>
) -> Path
Constructs a path from its segments.
Trait Implementations§
impl Eq for Path
impl StructuralEq for Path
impl StructuralPartialEq for Path
Auto Trait Implementations§
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnwindSafe for Path
Blanket Implementations§
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.