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>
impl<X: Transport + Default + 'static> System<X>
Sourcepub fn new(runtime: &Arc<StdRuntime<X>>) -> Self
pub fn new(runtime: &Arc<StdRuntime<X>>) -> Self
Instantiates a new system.
pub fn execute(self) -> BlockResult<Rc<dyn Process>>
pub fn input<M: Message + 'static>(&self) -> InputPort<M>
pub fn output<M: Message + 'static>(&self) -> OutputPort<M>
pub fn block<B: Block + Clone + 'static>(&mut self, block: B) -> B
pub fn connect<M: Message>( &self, source: &OutputPort<M>, target: &InputPort<M>, ) -> bool
Trait Implementations§
Source§impl SystemBuilding for System
impl SystemBuilding for System
Source§fn input<M: Message + 'static>(&self) -> InputPort<M>
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>
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
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
fn connect<M: Message>( &mut self, source: &OutputPort<M>, target: &InputPort<M>, ) -> bool
Connects two ports of two blocks in the system. Read more
fn input_any(&self) -> InputPort<Any>
fn input_bytes(&self) -> InputPort<Bytes>
fn input_string(&self) -> InputPort<String>
fn output_any(&self) -> OutputPort<Any>
fn output_bytes(&self) -> OutputPort<Bytes>
fn output_string(&self) -> OutputPort<String>
Source§impl SystemExecution for System
impl SystemExecution for System
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more