Struct protoflow_blocks::System

source ·
pub struct System(/* private fields */);

Implementations§

source§

impl System

source

pub fn run<F: FnOnce(&mut System)>(f: F) -> BlockResult

Builds and executes a system, blocking until completion.

source

pub fn spawn<F: FnOnce(&mut System)>(f: F) -> BlockResult<Rc<dyn Process>>

Builds and executes a system, returning immediately.

source

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

Builds a new system.

source

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

Instantiates a new system.

Trait Implementations§

source§

impl CoreBlocks for System

source§

fn buffer<T: Message + Into<T> + 'static>(&self) -> Buffer<T>

source§

fn const_string(&self, value: impl ToString) -> Const<String>

source§

fn count<T: Message + 'static>(&self) -> Count<T>

source§

fn delay<T: Message + 'static>(&self) -> Delay<T>

source§

fn delay_by<T: Message + 'static>(&self, delay: DelayType) -> Delay<T>

source§

fn drop<T: Message + 'static>(&self) -> Drop<T>

source§

fn random<T: Message + 'static>(&self) -> Random<T>

source§

fn random_seeded<T: Message + 'static>(&self, seed: Option<u64>) -> Random<T>

source§

fn delay_by_fixed<T: Message + 'static>(&self, delay: Duration) -> Delay<T>

source§

fn delay_by_random<T: Message + 'static>( &self, delay: Range<Duration>, ) -> Delay<T>

source§

impl HashBlocks for System

source§

impl IoBlocks for System

source§

fn decode<T: Message + FromStr + 'static>(&self) -> Decode<T>

source§

fn decode_with<T: Message + FromStr + 'static>( &self, encoding: Encoding, ) -> Decode<T>

source§

fn encode<T: Message + ToString + 'static>(&self) -> Encode<T>

source§

fn encode_with<T: Message + ToString + 'static>( &self, encoding: Encoding, ) -> Encode<T>

source§

fn encode_hex(&self) -> EncodeHex

source§

fn decode_lines<T: Message + FromStr + 'static>(&self) -> Decode<T>

source§

fn encode_lines<T: Message + ToString + 'static>(&self) -> Encode<T>

source§

impl SysBlocks for System

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.
source§

impl AllBlocks for System

source§

impl FlowBlocks for System

source§

impl MathBlocks for System

source§

impl TextBlocks for System

Auto Trait Implementations§

§

impl !Freeze for System

§

impl !RefUnwindSafe for System

§

impl Send for System

§

impl !Sync for System

§

impl Unpin for System

§

impl !UnwindSafe for System

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.
source§

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

source§

fn vzip(self) -> V