pub trait ComponentInstanceInterface:
Sized
+ Send
+ Sync {
type TopInstance: TopInstanceInterface + Send + Sync;
Show 15 methods
// Required methods
fn moniker(&self) -> &Moniker;
fn url(&self) -> &Url;
fn config_parent_overrides(&self) -> Option<&[ConfigOverride]>;
fn policy_checker(&self) -> &GlobalPolicyChecker;
fn component_id_index(&self) -> &Index;
fn try_get_parent(
&self,
) -> Result<ExtendedInstanceInterface<Self>, ComponentInstanceError>;
fn component_sandbox<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
) -> Pin<Box<dyn Future<Output = Result<ComponentSandbox, ComponentInstanceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_child_maybe_resolve<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
moniker: &'life1 BorrowedChildName,
) -> Pin<Box<dyn Future<Output = Result<Option<Arc<Self>>, ComponentInstanceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn address_maybe_resolve<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
) -> Pin<Box<dyn Future<Output = Result<ComponentAddress, ResolverError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn context_to_resolve_children<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
) -> Pin<Box<dyn Future<Output = Result<Option<ComponentResolutionContext>, ComponentInstanceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn as_weak(self: &Arc<Self>) -> WeakComponentInstanceInterface<Self> { ... }
fn child_moniker(&self) -> Option<&BorrowedChildName> { ... }
fn find_extended_instance<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
moniker: &'life1 ExtendedMoniker,
) -> Pin<Box<dyn Future<Output = Result<ExtendedInstanceInterface<Self>, ComponentInstanceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn find_absolute<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
target_moniker: &'life1 Moniker,
) -> Pin<Box<dyn Future<Output = Result<Arc<Self>, ComponentInstanceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn find_above_root(
self: &Arc<Self>,
) -> Result<Arc<Self::TopInstance>, ComponentInstanceError> { ... }
}Expand description
A trait providing a representation of a component instance.
Required Associated Types§
type TopInstance: TopInstanceInterface + Send + Sync
Required Methods§
Sourcefn config_parent_overrides(&self) -> Option<&[ConfigOverride]>
fn config_parent_overrides(&self) -> Option<&[ConfigOverride]>
Returns configuration overrides applied to this component by its parent.
Sourcefn policy_checker(&self) -> &GlobalPolicyChecker
fn policy_checker(&self) -> &GlobalPolicyChecker
Returns the GlobalPolicyChecker for this component instance.
Sourcefn component_id_index(&self) -> &Index
fn component_id_index(&self) -> &Index
Returns the component ID index for this component instance.
Sourcefn try_get_parent(
&self,
) -> Result<ExtendedInstanceInterface<Self>, ComponentInstanceError>
fn try_get_parent( &self, ) -> Result<ExtendedInstanceInterface<Self>, ComponentInstanceError>
Gets the parent, if it still exists, or returns an InstanceNotFound error.
Sourcefn component_sandbox<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
) -> Pin<Box<dyn Future<Output = Result<ComponentSandbox, ComponentInstanceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn component_sandbox<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
) -> Pin<Box<dyn Future<Output = Result<ComponentSandbox, ComponentInstanceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns a clone of this component’s sandbox. This may resolve the component if necessary.
Sourcefn get_child_maybe_resolve<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
moniker: &'life1 BorrowedChildName,
) -> Pin<Box<dyn Future<Output = Result<Option<Arc<Self>>, ComponentInstanceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_child_maybe_resolve<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
moniker: &'life1 BorrowedChildName,
) -> Pin<Box<dyn Future<Output = Result<Option<Arc<Self>>, ComponentInstanceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Returns a live child of this instance. This may resolve the component if necessary.
Sourcefn address_maybe_resolve<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
) -> Pin<Box<dyn Future<Output = Result<ComponentAddress, ResolverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn address_maybe_resolve<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
) -> Pin<Box<dyn Future<Output = Result<ComponentAddress, ResolverError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the resolver-ready location of the component, which is either an absolute component URL or a relative path URL with context. This may resolve the component if necessary.
Sourcefn context_to_resolve_children<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
) -> Pin<Box<dyn Future<Output = Result<Option<ComponentResolutionContext>, ComponentInstanceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn context_to_resolve_children<'life0, 'async_trait>(
self: &'life0 Arc<Self>,
) -> Pin<Box<dyn Future<Output = Result<Option<ComponentResolutionContext>, ComponentInstanceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the context to be used to resolve a component from a path
relative to this component (for example, a component in a subpackage).
If None, the resolver cannot resolve relative path component URLs.
This may resolve the component if necessary.
Provided Methods§
Sourcefn as_weak(self: &Arc<Self>) -> WeakComponentInstanceInterface<Self>
fn as_weak(self: &Arc<Self>) -> WeakComponentInstanceInterface<Self>
Returns a new WeakComponentInstanceInterface<Self> pointing to self.
Sourcefn child_moniker(&self) -> Option<&BorrowedChildName>
fn child_moniker(&self) -> Option<&BorrowedChildName>
Returns this ComponentInstanceInterface’s child moniker, if it is
not the root instance.
Sourcefn find_extended_instance<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
moniker: &'life1 ExtendedMoniker,
) -> Pin<Box<dyn Future<Output = Result<ExtendedInstanceInterface<Self>, ComponentInstanceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_extended_instance<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
moniker: &'life1 ExtendedMoniker,
) -> Pin<Box<dyn Future<Output = Result<ExtendedInstanceInterface<Self>, ComponentInstanceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Attempts to walk the component tree (up and/or down) from the current component to find the
extended instance represented by the given extended moniker. Intermediate components will
be resolved as needed. Functionally this calls into find_absolute or find_above_root
depending on the extended moniker.
Sourcefn find_absolute<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
target_moniker: &'life1 Moniker,
) -> Pin<Box<dyn Future<Output = Result<Arc<Self>, ComponentInstanceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn find_absolute<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
target_moniker: &'life1 Moniker,
) -> Pin<Box<dyn Future<Output = Result<Arc<Self>, ComponentInstanceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Attempts to walk the component tree (up and/or down) from the current component to find the component instance represented by the given moniker. Intermediate components will be resolved as needed.
Sourcefn find_above_root(
self: &Arc<Self>,
) -> Result<Arc<Self::TopInstance>, ComponentInstanceError>
fn find_above_root( self: &Arc<Self>, ) -> Result<Arc<Self::TopInstance>, ComponentInstanceError>
Attempts to walk the component tree up to the above root instance. Intermediate components will be resolved as needed.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".