pub enum PathRoot {
Relative,
Global,
SelfModule,
Super(u8),
SelfType,
ParentType,
StaticType,
}Expand description
Where a path starts.
§Examples
use hir_lang::PathRoot;
assert_eq!(PathRoot::default(), PathRoot::Relative);
assert!(PathRoot::StaticType.is_type_root());Variants§
Relative
Looked up from the current scope.
Global
::a — from the root module of the package.
SelfModule
self::a (Rust) — from the current module.
Super(u8)
super::a, super::super::a — from an enclosing module, this many
levels up (at least 1).
SelfType
Self::a (Rust), self::a (PHP) — relative to the enclosing
impl/interface/class type.
ParentType
parent::a (PHP) — relative to the enclosing class’s base class.
StaticType
static::a (PHP) — relative to the run-time class (late static
binding).
Implementations§
Trait Implementations§
impl Copy for PathRoot
impl Eq for PathRoot
impl StructuralPartialEq for PathRoot
Auto Trait Implementations§
impl Freeze for PathRoot
impl RefUnwindSafe for PathRoot
impl Send for PathRoot
impl Sync for PathRoot
impl Unpin for PathRoot
impl UnsafeUnpin for PathRoot
impl UnwindSafe for PathRoot
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