Struct 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>(&mut self, block: B) -> B

Source

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

Trait Implementations§

Source§

impl Debug for System

Source§

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

Formats the value using the given formatter. Read more
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>(&mut self, block: B) -> B

Instantiates a block inside the system.
Source§

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

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

fn input_any(&self) -> InputPort<Any>

Source§

fn input_bytes(&self) -> InputPort<Bytes>

Source§

fn input_string(&self) -> InputPort<String>

Source§

fn output_any(&self) -> OutputPort<Any>

Source§

fn output_bytes(&self) -> OutputPort<Bytes>

Source§

fn output_string(&self) -> OutputPort<String>

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> Freeze for System<X>

§

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

§

impl<X> Send for System<X>

§

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

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.