pub struct ProviderDescriptor { /* private fields */ }Expand description
Describes a statically declared provider and its constructor.
Implementations§
Source§impl ProviderDescriptor
impl ProviderDescriptor
Sourcepub const fn new(
kind: ProviderKind,
type_name: &'static str,
type_id: fn() -> TypeId,
dependencies: &'static [DependencyDescriptor],
visibility: ProviderVisibility,
location: SourceLocation,
constructor: ProviderConstructor,
) -> Self
pub const fn new( kind: ProviderKind, type_name: &'static str, type_id: fn() -> TypeId, dependencies: &'static [DependencyDescriptor], visibility: ProviderVisibility, location: SourceLocation, constructor: ProviderConstructor, ) -> Self
Creates a provider 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 provider declaration.
Sourcepub const fn kind(&self) -> ProviderKind
pub const fn kind(&self) -> ProviderKind
Returns the provider’s role.
Sourcepub const fn namespace(&self) -> Option<&'static str>
pub const fn namespace(&self) -> Option<&'static str>
Returns the Rust namespace containing this provider declaration, when available.
Sourcepub const fn dependencies(&self) -> &'static [DependencyDescriptor]
pub const fn dependencies(&self) -> &'static [DependencyDescriptor]
Returns the static dependency descriptors required by this provider.
Sourcepub const fn visibility(&self) -> ProviderVisibility
pub const fn visibility(&self) -> ProviderVisibility
Returns the provider’s declaration visibility metadata.
Sourcepub const fn location(&self) -> SourceLocation
pub const fn location(&self) -> SourceLocation
Returns the provider declaration’s source location.
Sourcepub const fn constructor(&self) -> ProviderConstructor
pub const fn constructor(&self) -> ProviderConstructor
Returns the provider constructor.
Trait Implementations§
impl Collect for ProviderDescriptor
Auto Trait Implementations§
impl Forget for ProviderDescriptor
impl Freeze for ProviderDescriptor
impl Move for ProviderDescriptor
impl RefUnwindSafe for ProviderDescriptor
impl Send for ProviderDescriptor
impl Sync for ProviderDescriptor
impl Unpin for ProviderDescriptor
impl UnsafeUnpin for ProviderDescriptor
impl UnwindSafe for ProviderDescriptor
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