pub struct ModuleDescriptor { /* private fields */ }Expand description
Describes a statically declared application module.
Implementations§
Source§impl ModuleDescriptor
impl ModuleDescriptor
Sourcepub const fn new(
type_name: &'static str,
type_id: fn() -> TypeId,
location: SourceLocation,
) -> Self
pub const fn new( type_name: &'static str, type_id: fn() -> TypeId, location: SourceLocation, ) -> Self
Creates a module descriptor from static declaration metadata.
Sourcepub const fn with_namespace(self, namespace: &'static str) -> Self
pub const fn with_namespace(self, namespace: &'static str) -> Self
Attaches the Rust namespace containing this module declaration.
Sourcepub const fn with_imports(
self,
imports: &'static [ModuleImportDescriptor],
) -> Self
pub const fn with_imports( self, imports: &'static [ModuleImportDescriptor], ) -> Self
Attaches the module’s direct imports in authored declaration order.
Sourcepub const fn with_global(self) -> Self
pub const fn with_global(self) -> Self
Marks the module as global, allowing its providers to be accessed from any module.
Sourcepub const fn namespace(&self) -> Option<&'static str>
pub const fn namespace(&self) -> Option<&'static str>
Returns the Rust namespace containing this module declaration, when available.
Sourcepub const fn imports(&self) -> &'static [ModuleImportDescriptor]
pub const fn imports(&self) -> &'static [ModuleImportDescriptor]
Returns the module’s direct imports in authored declaration order.
Sourcepub const fn location(&self) -> SourceLocation
pub const fn location(&self) -> SourceLocation
Returns the module declaration’s source location.
Trait Implementations§
impl Collect for ModuleDescriptor
Auto Trait Implementations§
impl Forget for ModuleDescriptor
impl Freeze for ModuleDescriptor
impl Move for ModuleDescriptor
impl RefUnwindSafe for ModuleDescriptor
impl Send for ModuleDescriptor
impl Sync for ModuleDescriptor
impl Unpin for ModuleDescriptor
impl UnsafeUnpin for ModuleDescriptor
impl UnwindSafe for ModuleDescriptor
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