Skip to main content

FixedFunctionDevice

Trait FixedFunctionDevice 

Source
pub trait FixedFunctionDevice: Send {
    // Required methods
    fn stage_id(&self) -> &str;
    fn execute(&mut self, input: &[f32]) -> Result<Vec<f32>, String>;
}
Expand description

The host-side driver for a piece of fixed-function hardware.

Implemented per board/link (PCIe, AXI on a Zynq PS, USB, UART). Keeping it a trait means the mesh side is testable with LoopbackFixedFunction and no hardware attached.

Required Methods§

Source

fn stage_id(&self) -> &str

The stage this board implements — must match the advertised descriptor.

Source

fn execute(&mut self, input: &[f32]) -> Result<Vec<f32>, String>

Push one activation to the board and read the result back.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§