pub struct SystemBuilder { /* private fields */ }Expand description
A builder for system definitions.
§Examples
use async_flow::model::SystemBuilder;
let mut builder = SystemBuilder::new();
//let block = builder.register(MyBlock::new());
let system = builder.build();Implementations§
Source§impl SystemBuilder
impl SystemBuilder
Sourcepub fn register<T: BlockDefinition>(&mut self, block: T) -> T
pub fn register<T: BlockDefinition>(&mut self, block: T) -> T
Registers a block.
Sourcepub fn register_input(&mut self, input: impl Into<InputId>)
pub fn register_input(&mut self, input: impl Into<InputId>)
Registers a block’s input port.
Sourcepub fn register_output(&mut self, output: impl Into<OutputId>)
pub fn register_output(&mut self, output: impl Into<OutputId>)
Registers a block’s output port.
Sourcepub fn connect<T>(
&mut self,
output: &Outputs<T>,
input: &Inputs<T>,
) -> Result<bool, SystemBuildError>
pub fn connect<T>( &mut self, output: &Outputs<T>, input: &Inputs<T>, ) -> Result<bool, SystemBuildError>
Connects an output port to an input port of the same type.
Returns a boolean indicating whether the connection was newly inserted or already existed.
Sourcepub fn build(self) -> SystemDefinition
pub fn build(self) -> SystemDefinition
Builds the system.
Trait Implementations§
Source§impl Clone for SystemBuilder
impl Clone for SystemBuilder
Source§fn clone(&self) -> SystemBuilder
fn clone(&self) -> SystemBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SystemBuilder
impl Debug for SystemBuilder
Source§impl Default for SystemBuilder
impl Default for SystemBuilder
Source§fn default() -> SystemBuilder
fn default() -> SystemBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SystemBuilder
impl RefUnwindSafe for SystemBuilder
impl Send for SystemBuilder
impl Sync for SystemBuilder
impl Unpin for SystemBuilder
impl UnwindSafe for SystemBuilder
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