Struct protoflow_core::System

source ·
pub struct System<X: Transport + Default + 'static = MpscTransport> { /* private fields */ }
Expand description

A system is a collection of blocks that are connected together.

Implementations§

source§

impl<X: Transport + Default + 'static> System<X>

source

pub fn build<F: FnOnce(&mut System<X>)>(f: F) -> Self

Builds a new system.

source

pub fn new(runtime: &Arc<StdRuntime<X>>) -> Self

Instantiates a new system.

source

pub fn execute(self) -> BlockResult<Rc<dyn Process>>

source

pub fn input<M: Message + 'static>(&self) -> InputPort<M>

source

pub fn output<M: Message + 'static>(&self) -> OutputPort<M>

source

pub fn block<B: Block + Clone + 'static>(&self, block: B) -> B

source

pub fn connect<M: Message>( &self, source: &OutputPort<M>, target: &InputPort<M>, ) -> bool

Trait Implementations§

source§

impl SystemBuilding for System

source§

fn input<M: Message + 'static>(&self) -> InputPort<M>

Creates a new input port inside the system.
source§

fn output<M: Message + 'static>(&self) -> OutputPort<M>

Creates a new output port inside the system.
source§

fn block<B: Block + Clone + 'static>(&self, block: B) -> B

Instantiates a block inside the system.
source§

fn connect<M: Message>( &self, source: &OutputPort<M>, target: &InputPort<M>, ) -> bool

Connects two ports of two blocks in the system. Read more
source§

impl SystemExecution for System

source§

fn execute(self) -> BlockResult<Rc<dyn Process>>

Executes the system, returning the system process.

Auto Trait Implementations§

§

impl<X = MpscTransport> !Freeze for System<X>

§

impl<X = MpscTransport> !RefUnwindSafe for System<X>

§

impl<X> Send for System<X>

§

impl<X = MpscTransport> !Sync for System<X>

§

impl<X> Unpin for System<X>
where X: Unpin,

§

impl<X = MpscTransport> !UnwindSafe for System<X>

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>,

§

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>,

§

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.