pub struct TypedAnyComponent<C: Component> { /* private fields */ }Expand description
Adapter from a typed Component to the type-erased AnyComponent
trait. Created by TypedFactory::build.
Implementations§
Source§impl<C: Component> TypedAnyComponent<C>
impl<C: Component> TypedAnyComponent<C>
Sourcepub fn new(instance: C) -> Self
pub fn new(instance: C) -> Self
Wraps a component instance into a type-erased AnyComponent.
Trait Implementations§
Source§impl<C: Component> AnyComponent for TypedAnyComponent<C>
impl<C: Component> AnyComponent for TypedAnyComponent<C>
Source§fn as_any_arc(&self) -> Arc<dyn Any + Send + Sync> ⓘ
fn as_any_arc(&self) -> Arc<dyn Any + Send + Sync> ⓘ
Underlying concrete type, used by
ComponentRegistry::get to
downcast back to a concrete Arc<C>. Returns a type-erased
Arc<dyn Any> clone of the typed instance.Source§fn start(&self) -> BoxFuture<'_, Result<(), AnyComponentError>>
fn start(&self) -> BoxFuture<'_, Result<(), AnyComponentError>>
Begin serving. See
Component::start.Source§fn stop(&self) -> BoxFuture<'_, Result<(), AnyComponentError>>
fn stop(&self) -> BoxFuture<'_, Result<(), AnyComponentError>>
Stop serving. See
Component::stop.Source§fn health(&self) -> BoxFuture<'_, HealthStatus>
fn health(&self) -> BoxFuture<'_, HealthStatus>
Health probe. See
Component::health.Source§fn pre_replace(&self) -> BoxFuture<'_, Result<(), AnyComponentError>>
fn pre_replace(&self) -> BoxFuture<'_, Result<(), AnyComponentError>>
Called before this component is replaced. See
Component::pre_replace_hook.Source§fn post_replace(&self) -> BoxFuture<'_, Result<(), AnyComponentError>>
fn post_replace(&self) -> BoxFuture<'_, Result<(), AnyComponentError>>
Called after this component has been replaced. See
Component::post_replace_hook.Auto Trait Implementations§
impl<C> Freeze for TypedAnyComponent<C>
impl<C> RefUnwindSafe for TypedAnyComponent<C>where
C: RefUnwindSafe,
impl<C> Send for TypedAnyComponent<C>
impl<C> Sync for TypedAnyComponent<C>
impl<C> Unpin for TypedAnyComponent<C>
impl<C> UnsafeUnpin for TypedAnyComponent<C>
impl<C> UnwindSafe for TypedAnyComponent<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
Mutably borrows from an owned value. Read more