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]) -> &Self
pub fn from_slice(segments: &[Ident]) -> &Self
Sourcepub unsafe fn from_slice_unchecked(segments: &[Ident]) -> &Self
pub unsafe fn from_slice_unchecked(segments: &[Ident]) -> &Self
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 Self
pub fn from_mut_slice(segments: &mut [Ident]) -> &mut Self
Sourcepub unsafe fn from_mut_slice_unchecked(segments: &mut [Ident]) -> &mut Self
pub unsafe fn from_mut_slice_unchecked(segments: &mut [Ident]) -> &mut Self
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.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self, then passes self.deref() into the pipe function.