pub struct InMemoryCapabilityRegistry { /* private fields */ }Expand description
In-memory CapabilityRegistry — starts empty, matching
HashMap::new()/Vec::new() convention. This crate has no knowledge
of, or dependency on, any specific technology or consumer; a caller
registers whichever named instances it needs (e.g.
grpc-egress:inventory-svc) via Self::register.
Implementations§
Source§impl InMemoryCapabilityRegistry
impl InMemoryCapabilityRegistry
Sourcepub fn register(
self,
name: impl Into<String>,
descriptor: CapabilityDescriptor,
) -> Self
pub fn register( self, name: impl Into<String>, descriptor: CapabilityDescriptor, ) -> Self
Registers descriptor under name, replacing any existing entry
with the same name. Fluent — chainable to build up a registry one
entry at a time.
Trait Implementations§
Source§impl CapabilityRegistry for InMemoryCapabilityRegistry
impl CapabilityRegistry for InMemoryCapabilityRegistry
Source§fn descriptor(&self, capability: &str) -> Option<&CapabilityDescriptor>
fn descriptor(&self, capability: &str) -> Option<&CapabilityDescriptor>
Look up
capability’s descriptor, if registered.Auto Trait Implementations§
impl Freeze for InMemoryCapabilityRegistry
impl RefUnwindSafe for InMemoryCapabilityRegistry
impl Send for InMemoryCapabilityRegistry
impl Sync for InMemoryCapabilityRegistry
impl Unpin for InMemoryCapabilityRegistry
impl UnsafeUnpin for InMemoryCapabilityRegistry
impl UnwindSafe for InMemoryCapabilityRegistry
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