Trait InputProps

Source
pub trait InputProps {
    type Reader;
    type Writer: Clone;

Show 17 methods // Required methods fn name(&self) -> &str; fn kind(&self) -> &HaystackKind; fn block_id(&self) -> &Uuid; fn is_connected(&self) -> bool; fn links(&self) -> Vec<&dyn Link>; fn add_link(&mut self, link: BaseLink<Self::Writer>); fn remove_link_by_id(&mut self, link_id: &Uuid); fn remove_target_block_links(&mut self, block_id: &Uuid); fn remove_all_links(&mut self); fn default(&self) -> &InputDefault; fn reader(&mut self) -> &mut Self::Reader; fn writer(&mut self) -> &mut Self::Writer; fn get_value(&self) -> Option<&Value>; fn increment_conn(&mut self) -> usize; fn decrement_conn(&mut self) -> usize; // Provided methods fn has_output(&self) -> bool { ... } fn remove_link(&mut self, link: &dyn Link) { ... }
}
Expand description

Defines the basic properties of a Block Input

Required Associated Types§

Source

type Reader

The input’s read type

Source

type Writer: Clone

The input’s write type

Required Methods§

Source

fn name(&self) -> &str

The input’s name

Source

fn kind(&self) -> &HaystackKind

The kind of data this input can receive

Source

fn block_id(&self) -> &Uuid

The block id of the block this input belongs to

Source

fn is_connected(&self) -> bool

True if this input is connected to at least one output or input of another block

Get a list of links to this output

Adds a link to this output

Remove a link by id from this input

§Arguments
  • link_id: The id of the link to be removed

Remove all links to a specific block from this input

Remove all links from this input

Source

fn default(&self) -> &InputDefault

This input’s defaults

Source

fn reader(&mut self) -> &mut Self::Reader

Get a reference to this input reader type

Source

fn writer(&mut self) -> &mut Self::Writer

Get a reference to this input writer type

Source

fn get_value(&self) -> Option<&Value>

Gets this input value

Source

fn increment_conn(&mut self) -> usize

Increment the connection count when this input is linked to another block’s output.

Source

fn decrement_conn(&mut self) -> usize

Decrement the connection count when the link to another block output is removed.

Provided Methods§

Source

fn has_output(&self) -> bool

True if this input has at least one output

Remove a link from this input

§Arguments
  • link: The link to be removed

Implementors§

Source§

impl<Reader, Writer: Clone> InputProps for BaseInput<Reader, Writer>

Implements the InputProps trait for BaseInput

Source§

type Reader = Reader

Source§

type Writer = Writer