Skip to main content

ImportOperator

Trait ImportOperator 

Source
pub trait ImportOperator<I, O>: Operator {
    // Required methods
    async fn import(&mut self, val: &I);
    async fn import_owned(&mut self, val: I);
    async fn eval(&mut self) -> O;

    // Provided method
    fn input_preference(&self) -> OwnershipPreference { ... }
}
Expand description

An import operator makes a stream from the parent circuit available inside a subcircuit.

Import operators are the only kind of operator that span two clock domains: an import operator reads a single value from the parent stream per parent clock tick and produces a stream of outputs in the nested circuit, one for each nested clock tick.

See Delta0 for a concrete example of an import operator.

Required Methods§

Source

async fn import(&mut self, val: &I)

Consumes a value from the parent stream by reference.

Either import or Self::import_owned is invoked once per nested clock epoch, right after clock_start(0).

Source

async fn import_owned(&mut self, val: I)

Consumes a value from the parent stream by value.

Source

async fn eval(&mut self) -> O

Invoked once per nested clock cycle to write a value to the output stream.

Provided Methods§

Source

fn input_preference(&self) -> OwnershipPreference

Ownership preference on the operator’s input stream (see OwnershipPreference).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<D> ImportOperator<D, D> for Delta0<D>
where D: HasZero + Clone + 'static,