protoflow_blocks

Trait SystemBuilding

source
pub trait SystemBuilding {
    // Required methods
    fn input<M>(&self) -> InputPort<M>
       where M: Message + 'static;
    fn output<M>(&self) -> OutputPort<M>
       where M: Message + 'static;
    fn block<B>(&mut self, block: B) -> B
       where B: Block + Clone + 'static;
    fn connect<M>(
        &mut self,
        source: &OutputPort<M>,
        target: &InputPort<M>,
    ) -> bool
       where M: Message;

    // Provided methods
    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> { ... }
}

Required Methods§

source

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

Creates a new input port inside the system.

source

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

Creates a new output port inside the system.

source

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

Instantiates a block inside the system.

source

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

Connects two ports of two blocks in the system.

Both ports must be of the same message type.

Provided Methods§

Object Safety§

This trait is not object safe.

Implementors§

source§

impl SystemBuilding for protoflow_core::system::System

source§

impl SystemBuilding for protoflow_blocks::System