#[non_exhaustive]pub struct Namespace {
pub path: StaticVec<Ident>,
pub index: Option<NonZeroUsize>,
}
Expand description
(internals) A chain of module names to namespace-qualify a variable or function call.
Exported under the internals
feature only.
Not available under no_module
.
A u64
offset to the current stack of imported modules in the
global runtime state is cached for quick search purposes.
A StaticVec
is used because the vast majority of namespace-qualified access contains only
one level, and it is wasteful to always allocate a Vec
with one element.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.path: StaticVec<Ident>
Path segments.
index: Option<NonZeroUsize>
Cached index into the current stack of imported modules, if any.
Implementations§
Trait Implementations§
source§impl PartialEq for Namespace
impl PartialEq for Namespace
impl Eq for Namespace
impl StructuralPartialEq for Namespace
Auto Trait Implementations§
impl Freeze for Namespace
impl RefUnwindSafe for Namespace
impl !Send for Namespace
impl !Sync for Namespace
impl Unpin for Namespace
impl UnwindSafe for Namespace
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> Variant for T
impl<T> Variant for T
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert this
Variant
trait object to &mut dyn Any
.source§fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
fn as_boxed_any(self: Box<T>) -> Box<dyn Any>
Convert this
Variant
trait object to Box<dyn Any>
.