pub struct Path(pub Vec<PathSegment>);Tuple Fields§
§0: Vec<PathSegment>Implementations§
Source§impl Path
impl Path
pub fn to_strings(&self) -> Vec<String>
pub fn to_named_strs(&self) -> Vec<Option<&str>>
Sourcepub fn from_idents(elems: &[&Loc<Identifier>]) -> Self
pub fn from_idents(elems: &[&Loc<Identifier>]) -> Self
Generate a path from a list of Loc
pub fn ident(ident: Loc<Identifier>) -> Self
pub fn ident_with_loc(ident: Loc<Identifier>) -> Loc<Self>
pub fn push_segment(&self, segment: PathSegment) -> Path
pub fn push_ident(&self, ident: Loc<Identifier>) -> Path
pub fn pop(&self) -> Self
pub fn join(&self, other: Path) -> Path
pub fn extract_prefix(&self) -> (PathPrefix, Path)
Sourcepub fn tail(&self) -> PathSegment
pub fn tail(&self) -> PathSegment
The last element of the path. Panics if the path is empty
Sourcepub fn prelude(&self) -> Path
pub fn prelude(&self) -> Path
Returns the whole path apart from the tail. Panics if the path is empty
pub fn starts_with(&self, other: &Path) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Path
impl<'de> Deserialize<'de> for Path
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
impl Eq for Path
impl StructuralPartialEq for Path
Auto Trait Implementations§
impl Freeze for Path
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnwindSafe for Path
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more