Struct SingleThreadedEngine

Source
pub struct SingleThreadedEngine { /* private fields */ }
Expand description

Creates single threaded execution environment for Blocks to be run on.

Each block would be executed inside a local task in the engine’s local context.

Implementations§

Source§

impl SingleThreadedEngine

Source

pub fn new() -> Self

Construct

Source

pub fn blocks(&self) -> Vec<&dyn BlockPropsType>

Get a list of all the blocks that are currently scheduled on this engine.

Source

pub fn blocks_mut(&self) -> Vec<&mut dyn BlockPropsType>

Get a list of all the blocks that are currently scheduled on this engine.

Trait Implementations§

Source§

impl Default for SingleThreadedEngine

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Engine for SingleThreadedEngine

Source§

type Writer = Sender<Value>

The transmission type of the blocks
Source§

type Reader = Receiver<Value>

The reception type of the blocks
Source§

type Channel = Sender<EngineMessage<Sender<WatchMessage>>>

The type used to send messages to/from this engine.
Source§

fn schedule<B: Block<Writer = Self::Writer, Reader = Self::Reader> + 'static>( &mut self, block: B, )

Schedule a block to be executed by this engine. This operation can be performed while the engine is running.
Load the blocks and links into the engine. This operation should be performed before the engine is run.
Source§

async fn run(&mut self)

Runs the event loop of this engine an execute the blocks that where scheduled
Source§

fn create_message_channel( &mut self, sender_id: Uuid, sender_channel: Self::Channel, ) -> Self::Channel

Get a handle to this engines messaging system so external systems can communicate with this engine once the engine will run. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V