pub struct AnonymizedAggregateServiceProvider<C: ComponentInstanceInterface> {
pub containing_component: WeakComponentInstanceInterface<C>,
pub members: Vec<AggregateMember>,
pub capability_name: Name,
pub capability_type: CapabilityTypeName,
pub sources: Sources,
}
Expand description
Provides capabilities exposed by an anonymized aggregates.
Given a set of collections and static children and the name of a capability, this provider returns a list of children within them that expose the capability, and routes to a particular child’s exposed capability with that name.
This is used during collection routing from anonymized aggregate service instances.
Fields§
§containing_component: WeakComponentInstanceInterface<C>
Component that defines the aggregate.
members: Vec<AggregateMember>
The members relative to containing_component
that make up the aggregate.
capability_name: Name
Name of the capability as exposed by children in the collection.
capability_type: CapabilityTypeName
§sources: Sources
Implementations§
Source§impl<C> AnonymizedAggregateServiceProvider<C>where
C: ComponentInstanceInterface + 'static,
impl<C> AnonymizedAggregateServiceProvider<C>where
C: ComponentInstanceInterface + 'static,
Sourcepub async fn new_from_capability_source(
source: &CapabilitySource,
source_component_instance: &Arc<C>,
) -> Option<Self>
pub async fn new_from_capability_source( source: &CapabilitySource, source_component_instance: &Arc<C>, ) -> Option<Self>
Creates a new AnonymizedAggregateServiceProvider
from a
CapabilitySource::AnonymizedAggregate
. The source_component_instance
must have a
moniker that matches the moniker value in the source. None is returned if source is not a
CapabilitySource::AnonymizedAggregate
.
Sourcepub async fn list_instances(
&self,
) -> Result<Vec<AggregateInstance>, RoutingError>
pub async fn list_instances( &self, ) -> Result<Vec<AggregateInstance>, RoutingError>
Returns a list of instances contributing capabilities to this provider.
In the case of service capabilities, they are not instances inside that service, but rather service capabilities with the same name that are exposed by different components.
Sourcepub async fn route_instance<V>(
&self,
instance: &AggregateInstance,
visitor: &mut V,
) -> Result<CapabilitySource, RoutingError>
pub async fn route_instance<V>( &self, instance: &AggregateInstance, visitor: &mut V, ) -> Result<CapabilitySource, RoutingError>
Returns a CapabilitySource
to a capability exposed by a child.
instance
is the name of the child that exposes the capability, as returned by
list_instances
.
Trait Implementations§
Source§impl<C: Clone + ComponentInstanceInterface> Clone for AnonymizedAggregateServiceProvider<C>
impl<C: Clone + ComponentInstanceInterface> Clone for AnonymizedAggregateServiceProvider<C>
Source§fn clone(&self) -> AnonymizedAggregateServiceProvider<C>
fn clone(&self) -> AnonymizedAggregateServiceProvider<C>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<C> Freeze for AnonymizedAggregateServiceProvider<C>
impl<C> RefUnwindSafe for AnonymizedAggregateServiceProvider<C>where
C: RefUnwindSafe,
impl<C> Send for AnonymizedAggregateServiceProvider<C>
impl<C> Sync for AnonymizedAggregateServiceProvider<C>
impl<C> Unpin for AnonymizedAggregateServiceProvider<C>
impl<C> UnwindSafe for AnonymizedAggregateServiceProvider<C>where
C: RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)