pub struct CapabilityRegistry { /* private fields */ }Expand description
In-process registry of local capability handlers.
Implementations§
Source§impl CapabilityRegistry
impl CapabilityRegistry
Sourcepub fn register_handler<H>(&mut self, handler: H) -> CapabilityResult<()>where
H: LocalCapabilityHandler + 'static,
pub fn register_handler<H>(&mut self, handler: H) -> CapabilityResult<()>where
H: LocalCapabilityHandler + 'static,
Registers an owned local handler.
Registers a shared local handler.
Sourcepub fn get(
&self,
capability: &CapabilityName,
) -> Option<&LocalCapabilityProvider>
pub fn get( &self, capability: &CapabilityName, ) -> Option<&LocalCapabilityProvider>
Returns the local provider registered for a capability.
Sourcepub fn descriptors(&self) -> Vec<CapabilityDescriptor>
pub fn descriptors(&self) -> Vec<CapabilityDescriptor>
Returns descriptors for all registered local providers.
Use Self::iter_descriptors when owned copies are unnecessary.
Sourcepub fn iter_descriptors(
&self,
) -> impl ExactSizeIterator<Item = &CapabilityDescriptor>
pub fn iter_descriptors( &self, ) -> impl ExactSizeIterator<Item = &CapabilityDescriptor>
Borrows descriptors without allocating or cloning them.
Iteration order is unspecified, as with Self::descriptors.
Trait Implementations§
Source§impl Clone for CapabilityRegistry
impl Clone for CapabilityRegistry
Source§fn clone(&self) -> CapabilityRegistry
fn clone(&self) -> CapabilityRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CapabilityRegistry
impl Debug for CapabilityRegistry
Source§impl Default for CapabilityRegistry
impl Default for CapabilityRegistry
Source§fn default() -> CapabilityRegistry
fn default() -> CapabilityRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for CapabilityRegistry
impl !UnwindSafe for CapabilityRegistry
impl Freeze for CapabilityRegistry
impl Send for CapabilityRegistry
impl Sync for CapabilityRegistry
impl Unpin for CapabilityRegistry
impl UnsafeUnpin for CapabilityRegistry
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