[−][src]Struct kompact::component::Component
A concrete component instance
The component class itself is application agnostic, but it contains the application specific ComponentDefinition.
Implementations
impl<CD: ComponentTraits> Component<CD>
[src]
pub fn definition_mut(&mut self) -> &mut CD
[src]
Returns a mutable reference to the underlying component definition.
This can only be done if you have a reference to the component instance that isn't hidden behind an Arc. For example, after the system shuts down and your code holds on to the last reference to a component you can use get_mut or try_unwrap.
pub fn on_definition<T, F>(&self, f: F) -> T where
F: FnOnce(&mut CD) -> T,
[src]
F: FnOnce(&mut CD) -> T,
Execute a function on the underlying ComponentDefinition and return the result
This method will attempt to lock the mutex, and then apply f
to the component definition
inside the guard.
pub fn logger(&self) -> &KompactLogger
[src]
Returns a reference to this component's logger
pub fn is_faulty(&self) -> bool
[src]
Returns true
if the component is marked as faulty.
pub fn is_active(&self) -> bool
[src]
Returns true
if the component is marked as active.
pub fn is_destroyed(&self) -> bool
[src]
Returns true
if the component is marked as destroyed.
pub fn wait_ended(&self)
[src]
Wait synchronously for this component be either destroyed or faulty
This component blocks the current thread and hot-waits for the component to become either faulty or destroyed. It is meant mostly for testing and not recommended in production.
pub fn set_recovery_function<F>(&self, f: F) where
F: FnOnce(FaultContext) -> RecoveryHandler + Send + 'static,
[src]
F: FnOnce(FaultContext) -> RecoveryHandler + Send + 'static,
Set the recovery function for this component
See RecoveryHandler for more information.
Trait Implementations
impl<C> AbstractComponent for Component<C> where
C: ComponentTraits + ComponentLifecycle,
[src]
C: ComponentTraits + ComponentLifecycle,
fn dyn_definition_mut(
&mut self
) -> &mut dyn DynamicComponentDefinition<Message = Self::Message>
[src]
&mut self
) -> &mut dyn DynamicComponentDefinition<Message = Self::Message>
fn lock_dyn_definition(
&self
) -> Result<DynamicComponentDefinitionMutexGuard<'_, Self::Message>, LockPoisoned>
[src]
&self
) -> Result<DynamicComponentDefinitionMutexGuard<'_, Self::Message>, LockPoisoned>
fn as_any(&self) -> &dyn Any
[src]
impl<CD: ComponentTraits> ActorRefFactory for Component<CD>
[src]
type Message = CD::Message
The type of messages carried by references produced by this factory
fn actor_ref(&self) -> ActorRef<CD::Message>
[src]
impl<CD> ArcWake for Component<CD> where
CD: ComponentTraits + ComponentLifecycle,
[src]
CD: ComponentTraits + ComponentLifecycle,
impl<CD: ComponentTraits> CoreContainer for Component<CD>
[src]
fn id(&self) -> Uuid
[src]
fn core(&self) -> &ComponentCore
[src]
fn execute(&self) -> SchedulingDecision
[src]
fn schedule(&self)
[src]
fn type_name(&self) -> &'static str
[src]
fn dyn_message_queue(&self) -> &dyn DynMsgQueue
[src]
fn enqueue_control(&self, event: ControlEvent)
[src]
fn system(&self) -> &KompactSystem
[src]
impl<CD: ComponentTraits> Debug for Component<CD>
[src]
Auto Trait Implementations
impl<CD> !RefUnwindSafe for Component<CD>
impl<CD> Send for Component<CD> where
<CD as ActorRaw>::Message: Send,
<CD as ActorRaw>::Message: Send,
impl<CD> Sync for Component<CD> where
<CD as ActorRaw>::Message: Send,
<CD as ActorRaw>::Message: Send,
impl<CD> Unpin for Component<CD> where
CD: Unpin,
<CD as ActorRaw>::Message: Unpin,
CD: Unpin,
<CD as ActorRaw>::Message: Unpin,
impl<CD> !UnwindSafe for Component<CD>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,