pub struct Path(pub Vec<Loc<Identifier>>);
Tuple Fields§
§0: Vec<Loc<Identifier>>
Implementations§
Source§impl Path
impl Path
pub fn as_strs(&self) -> Vec<&str>
pub fn as_strings(&self) -> Vec<String>
pub fn ident(ident: Loc<Identifier>) -> Self
pub fn push_ident(&self, ident: Loc<Identifier>) -> Path
pub fn pop(&self) -> Self
pub fn join(&self, other: Path) -> Path
Sourcepub fn lib_relative(&self) -> Option<Path>
pub fn lib_relative(&self) -> Option<Path>
If the path is lib::
Sourcepub fn tail(&self) -> Identifier
pub fn tail(&self) -> Identifier
The last element of the path. Panics if the path is empty
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
Source§impl WithLocation for Path
impl WithLocation for Path
fn at(self, file_id: usize, span: &impl HasCodespan) -> Loc<Self>where
Self: Sized,
fn between( self, file_id: usize, start: &impl HasCodespan, end: &impl HasCodespan, ) -> Loc<Self>
fn between_locs<T, Y>(self, start: &Loc<T>, end: &Loc<Y>) -> Loc<Self>
fn nowhere(self) -> Loc<Self>where
Self: Sized,
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