[][src]Struct dqcsim::host::configuration::SimulatorConfiguration

pub struct SimulatorConfiguration {
    pub seed: Seed,
    pub stderr_level: LoglevelFilter,
    pub tee_files: Vec<TeeFileConfiguration>,
    pub log_callback: Option<LogCallback>,
    pub dqcsim_level: LoglevelFilter,
    pub plugins: Vec<Box<dyn PluginConfiguration>>,
    pub reproduction_path_style: Option<ReproductionPathStyle>,
}

The complete configuration for a DQCsim run.

Fields

seed: Seed

The random seed for the simulation.

stderr_level: LoglevelFilter

The verbosity for logging messages to stderr.

tee_files: Vec<TeeFileConfiguration>

Logs messages to the specified file in addition to stderr. level sets the minimum importance for a message to be logged to this file.

log_callback: Option<LogCallback>

Optional log callback function.

dqcsim_level: LoglevelFilter

The verbosity for DQCsim itself.

plugins: Vec<Box<dyn PluginConfiguration>>

The plugin configurations, from front to back.

reproduction_path_style: Option<ReproductionPathStyle>

The path style used when writing the reproduction file.

Methods

impl SimulatorConfiguration[src]

pub fn with_seed(self, seed: impl Into<Seed>) -> SimulatorConfiguration[src]

Sets the random seed.

pub fn with_stderr_level(
    self,
    level: impl Into<LoglevelFilter>
) -> SimulatorConfiguration
[src]

Sets the stderr loglevel.

pub fn with_tee_file(
    self,
    tee: impl Into<TeeFileConfiguration>
) -> SimulatorConfiguration
[src]

Adds a tee file.

pub fn with_log_callback(
    self,
    callback: impl Into<LogCallback>
) -> SimulatorConfiguration
[src]

Sets the log callback.

pub fn with_dqcsim_level(
    self,
    level: impl Into<LoglevelFilter>
) -> SimulatorConfiguration
[src]

Sets the verbosity for DQCsim itself.

pub fn with_plugin(
    self,
    plugin_configuration: impl Into<Box<dyn PluginConfiguration>>
) -> SimulatorConfiguration
[src]

Adds a new plugin to the pipeline.

pub fn with_reproduction_path_style(
    self,
    reproduction_path_style: impl Into<ReproductionPathStyle>
) -> SimulatorConfiguration
[src]

Sets the reproduction path style.

pub fn without_reproduction(self) -> SimulatorConfiguration[src]

Disables the reproduction logging system.

pub fn without_logging(self) -> SimulatorConfiguration[src]

Disables all logging methods by setting stderr_level and dqcsim_level to LoglevelFilter::Off, tee_files to an empty vector and log_callback to none.

pub fn optimize_loglevels(&mut self)[src]

Optimizes the source verbosity levels, such that they are no more verbose than the most verbose sink.

pub fn check_plugin_list(&mut self) -> Result<()>[src]

Verifies that the plugins are specified correctly.

This checks that there is exactly one frontend and exactly one backend. If this is true but they're not in the right place, they are silently moved. This also ensures that there are no duplicate plugin names, and auto-names empty plugin names.

Trait Implementations

impl Default for SimulatorConfiguration[src]

fn default() -> SimulatorConfiguration[src]

Generates a default configuration.

Note that the plugins vector still needs to be populated with at least two plugins.

impl Debug for SimulatorConfiguration[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,