Trait InputReader

Source
pub trait InputReader: Block {
    // Required methods
    async fn read_inputs(&mut self) -> Option<usize>;
    async fn read_inputs_until_ready(&mut self) -> Option<usize>;
    async fn wait_on_inputs(&mut self, timeout: Duration) -> Option<usize>;
}
Expand description

Specifies the protocol for reading block inputs

Required Methods§

Source

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

Reads the connected block inputs.

§Returns

The index of the input that received a value.

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.

§Returns

The index of the input that received a value.

Source

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

Waits for any input to have data.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<B: Block> InputReader for B