substrate::simulation

Trait Simulator

Source
pub trait Simulator:
    Installation
    + Any
    + Send
    + Sync {
    type Schema: Schema;
    type Input;
    type Options;
    type Output;
    type Error;

    // Required method
    fn simulate_inputs(
        &self,
        ctx: &SimulationContext<Self>,
        options: Self::Options,
        input: Vec<Self::Input>,
    ) -> Result<Vec<Self::Output>, Self::Error>;

    // Provided method
    fn simulate<A>(
        &self,
        ctx: &SimulationContext<Self>,
        options: Self::Options,
        input: A,
    ) -> Result<A::Output, Self::Error>
       where A: SupportedBy<Self>,
             Self: Sized { ... }
}
Expand description

A circuit simulator.

Required Associated Types§

Source

type Schema: Schema

The schema that this simulator uses.

Source

type Input

The input type this simulator accepts.

Source

type Options

Options shared across all analyses for a given simulator run.

Source

type Output

The output type produced by this simulator.

Source

type Error

The error type returned by the simulator.

Required Methods§

Source

fn simulate_inputs( &self, ctx: &SimulationContext<Self>, options: Self::Options, input: Vec<Self::Input>, ) -> Result<Vec<Self::Output>, Self::Error>

Simulates the given set of analyses.

Provided Methods§

Source

fn simulate<A>( &self, ctx: &SimulationContext<Self>, options: Self::Options, input: A, ) -> Result<A::Output, Self::Error>
where A: SupportedBy<Self>, Self: Sized,

Simulates the given, possibly composite, analysis.

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§