Add

Struct Add 

Source
pub struct Add {
    pub out: BaseOutput<BaseLink<Sender<Value>>>,
    /* private fields */
}
Expand description

Performs an addition of multiple numbers from the 16 inputs this block has. The addition would take into account the units of those input’s values, if the units are not convertible, the block would be in an error state.

Fields§

§out: BaseOutput<BaseLink<Sender<Value>>>

Implementations§

Source§

impl Add

Source

pub fn new() -> Self

Source

pub fn new_uuid(uuid: Uuid) -> Self

Trait Implementations§

Source§

impl Block for Add

Source§

async fn execute(&mut self)

Source§

impl BlockProps for Add

Source§

type Reader = <BaseInput<Receiver<Value>, Sender<Value>> as InputProps>::Reader

The block’s read type This is the type used to read from the block’s inputs
Source§

type Writer = <BaseInput<Receiver<Value>, Sender<Value>> as InputProps>::Writer

The block’s write type This is the type used to write to the block’s outputs
Source§

fn id(&self) -> &Uuid

Blocks unique id
Source§

fn name(&self) -> &str

Blocks name
Source§

fn desc(&self) -> &'static BlockDesc

Block’s static description
Source§

fn state(&self) -> BlockState

Blocks state
Source§

fn set_state(&mut self, state: BlockState) -> BlockState

Set the blocks state
Source§

fn inputs( &self, ) -> Vec<&dyn Input<Reader = Self::Reader, Writer = Self::Writer>>

List all the block inputs
Source§

fn inputs_mut( &mut self, ) -> Vec<&mut dyn Input<Reader = Self::Reader, Writer = Self::Writer>>

List all the block inputs
Source§

fn outputs_mut(&mut self) -> Vec<&mut dyn Output<Writer = Self::Writer>>

Mutable reference to the block’s output
Source§

fn outputs(&self) -> Vec<&dyn Output<Writer = Self::Writer>>

The block outputs
List all the links this block has
Remove a link by its id from the link collection
Remove all links from this block
Source§

fn get_input( &self, name: &str, ) -> Option<&dyn Input<Reader = Self::Reader, Writer = Self::Writer>>

Get block input by name
Source§

fn get_input_mut( &mut self, name: &str, ) -> Option<&mut dyn Input<Reader = Self::Reader, Writer = Self::Writer>>

Get block mutable input by name
Source§

fn get_output(&self, name: &str) -> Option<&dyn Output<Writer = Self::Writer>>

Get block output by name
Source§

fn get_output_mut( &mut self, name: &str, ) -> Option<&mut dyn Output<Writer = Self::Writer>>

Get block mutable output by name
Remove a link from the link collection
Source§

impl BlockStaticDesc for Add

Source§

fn desc() -> &'static BlockDesc

Static access to the block description
Source§

impl Debug for Add

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Add

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Add

§

impl RefUnwindSafe for Add

§

impl Send for Add

§

impl Sync for Add

§

impl Unpin for Add

§

impl UnwindSafe for Add

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> BlockConnect for T
where T: Block + ?Sized,

Source§

fn connect_output( &mut self, source_output_name: &str, target_input: &mut dyn InputProps<Writer = <T as BlockProps>::Writer, Reader = <T as BlockProps>::Reader>, ) -> Result<Uuid, &'static str>

Connect a block output to the given input Read more
Source§

fn connect_input( &mut self, source_input_name: &str, target_input: &mut dyn InputProps<Writer = <T as BlockProps>::Writer, Reader = <T as BlockProps>::Reader>, ) -> Result<Uuid, &'static str>

Connect a block input to another’s block input Read more
Source§

fn disconnect_output( &mut self, source_output_name: &str, target_input: &mut dyn InputProps<Writer = <T as BlockProps>::Writer, Reader = <T as BlockProps>::Reader>, ) -> Result<(), &'static str>

Disconnect a block output from the given input Read more
Source§

fn disconnect_input( &mut self, source_input_name: &str, target_input: &mut dyn InputProps<Writer = <T as BlockProps>::Writer, Reader = <T as BlockProps>::Reader>, ) -> Result<(), &'static str>

Disconnect a block input from the given output 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<B> InputReader for B
where B: Block,

Source§

async fn read_inputs(&mut self) -> Option<usize>

Reads the connected block inputs. Read more
Source§

async fn read_inputs_until_ready(&mut self) -> Option<usize>

Reads the connected block inputs. This would only complete when at least one input has data. Read more
Source§

async fn wait_on_inputs(&mut self, timeout: Duration) -> Option<usize>

Waits for any input to have data.
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.
Source§

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

Source§

fn vzip(self) -> V