[][src]Struct kompact::component::Component

pub struct Component<CD: ComponentTraits> { /* fields omitted */ }

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]

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]

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]

impl<CD: ComponentTraits> ActorRefFactory for Component<CD>[src]

type Message = CD::Message

The type of messages carried by references produced by this factory

impl<CD> ArcWake for Component<CD> where
    CD: ComponentTraits + ComponentLifecycle
[src]

impl<CD: ComponentTraits> CoreContainer for Component<CD>[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

impl<CD> Sync for Component<CD> where
    <CD as ActorRaw>::Message: Send

impl<CD> Unpin for Component<CD> where
    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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[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]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,