Skip to main content

CoreContainer

Trait CoreContainer 

Source
pub trait CoreContainer: Send + Sync {
    // Required methods
    fn id(&self) -> Uuid;
    fn core(&self) -> &ComponentCore;
    fn execute(&self) -> SchedulingDecision;
    fn schedule(&self);
    fn type_name(&self) -> &'static str;
    fn dyn_message_queue(&self) -> &dyn DynMsgQueue;
    fn enqueue_control(&self, event: ControlEvent);

    // Provided method
    fn system(&self) -> &KompactSystem { ... }
}
Expand description

A trait for abstracting over structures that contain a component core

Used for implementing scheduling and execution logic, such as Scheduler.

Required Methods§

Source

fn id(&self) -> Uuid

Returns the component’s unique id

Source

fn core(&self) -> &ComponentCore

Returns a reference to the actual component core

Source

fn execute(&self) -> SchedulingDecision

Executes this component on the current thread

Source

fn schedule(&self)

Schedules this component on its associated scheduler

Source

fn type_name(&self) -> &'static str

The descriptive string of the ComponentDefinition type wrapped in this container

Source

fn dyn_message_queue(&self) -> &dyn DynMsgQueue

Returns the underlying message queue of this component without the type information

Source

fn enqueue_control(&self, event: ControlEvent)

Enqueue an event on the component’s control queue

Not usually something you need to manually, unless you nned custom supervisor behaviours, for example.

Provided Methods§

Source

fn system(&self) -> &KompactSystem

Returns this component’s system

Trait Implementations§

Source§

impl Debug for dyn CoreContainer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Implementors§