pub struct BackendRegistry { /* private fields */ }Expand description
In-memory table of verified backend handles.
Implementations§
Source§impl BackendRegistry
impl BackendRegistry
Sourcepub fn insert(
&mut self,
instance: BrokerInstanceKey,
handle: BackendHandle,
) -> Option<BackendHandle>
pub fn insert( &mut self, instance: BrokerInstanceKey, handle: BackendHandle, ) -> Option<BackendHandle>
Insert or replace one verified backend handle.
Sourcepub fn get(
&self,
instance: &BrokerInstanceKey,
service_name: &str,
service_version: &str,
) -> Option<&BackendHandle>
pub fn get( &self, instance: &BrokerInstanceKey, service_name: &str, service_version: &str, ) -> Option<&BackendHandle>
Return one handle by exact instance/service/version key.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&BackendKey, &BackendHandle)>
pub fn iter(&self) -> impl Iterator<Item = (&BackendKey, &BackendHandle)>
Iterate over all registered backend handles.
Sourcepub fn prune_stale(&mut self) -> Vec<BackendKey>
pub fn prune_stale(&mut self) -> Vec<BackendKey>
Remove backend handles whose verified process is no longer alive.
Returns the removed keys so the lifecycle monitor can emit events, metrics, or diagnostics after the registry mutation is complete.
Sourcepub fn registered_backend_for(
&self,
instance: &BrokerInstanceKey,
service_definition: &ServiceDefinition,
service_version: &str,
) -> Option<RegisteredBackend>
pub fn registered_backend_for( &self, instance: &BrokerInstanceKey, service_definition: &ServiceDefinition, service_version: &str, ) -> Option<RegisteredBackend>
Return Hello negotiation metadata for one registered backend.
Trait Implementations§
Source§impl Default for BackendRegistry
impl Default for BackendRegistry
Source§fn default() -> BackendRegistry
fn default() -> BackendRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for BackendRegistry
impl RefUnwindSafe for BackendRegistry
impl Send for BackendRegistry
impl Sync for BackendRegistry
impl Unpin for BackendRegistry
impl UnsafeUnpin for BackendRegistry
impl UnwindSafe for BackendRegistry
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more