pub struct PathSlice(/* private fields */);Expand description
A qualified identifier: foo.bar.baz.
This is a list of identifiers, and is never empty.
Implementations§
Source§impl PathSlice
impl PathSlice
Sourcepub fn from_slice(segments: &[Ident]) -> &PathSlice
pub fn from_slice(segments: &[Ident]) -> &PathSlice
Sourcepub unsafe fn from_slice_unchecked(segments: &[Ident]) -> &PathSlice
pub unsafe fn from_slice_unchecked(segments: &[Ident]) -> &PathSlice
Creates a new path from a slice of segments.
§Safety
The caller must ensure that segments is not empty.
Sourcepub fn from_mut_slice(segments: &mut [Ident]) -> &mut PathSlice
pub fn from_mut_slice(segments: &mut [Ident]) -> &mut PathSlice
Sourcepub unsafe fn from_mut_slice_unchecked(segments: &mut [Ident]) -> &mut PathSlice
pub unsafe fn from_mut_slice_unchecked(segments: &mut [Ident]) -> &mut PathSlice
Creates a new path from a mutable slice of segments.
§Safety
The caller must ensure that segments is not empty.
Sourcepub fn segments_mut(&mut self) -> &mut [Ident]
pub fn segments_mut(&mut self) -> &mut [Ident]
Returns the path’s segments.
Sourcepub fn get_ident(&self) -> Option<&Ident>
pub fn get_ident(&self) -> Option<&Ident>
If this path consists of a single ident, returns the ident.
Sourcepub fn get_ident_mut(&mut self) -> Option<&mut Ident>
pub fn get_ident_mut(&mut self) -> Option<&mut Ident>
If this path consists of a single ident, returns the ident.
Trait Implementations§
Source§impl PartialOrd for PathSlice
impl PartialOrd for PathSlice
Source§impl ToOwned for PathSlice
impl ToOwned for PathSlice
impl Eq for PathSlice
impl StructuralPartialEq for PathSlice
Auto Trait Implementations§
impl Freeze for PathSlice
impl RefUnwindSafe for PathSlice
impl Send for PathSlice
impl !Sized for PathSlice
impl Sync for PathSlice
impl Unpin for PathSlice
impl UnwindSafe for PathSlice
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.