pub struct BenchmarkConfig {
pub measurement: MeasurementConfig,
pub comparison: ComparisonConfig,
}Expand description
Complete SimpleBench configuration
Fields§
§measurement: MeasurementConfig§comparison: ComparisonConfigImplementations§
Source§impl BenchmarkConfig
impl BenchmarkConfig
Sourcepub fn load() -> Self
pub fn load() -> Self
Load configuration with priority: env vars > config file > defaults
This is called by the generated runner at startup.
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, Box<dyn Error>>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self, Box<dyn Error>>
Load configuration from a TOML file
Sourcepub fn apply_env_overrides(&mut self)
pub fn apply_env_overrides(&mut self)
Apply environment variable overrides
This allows CLI args (passed via env vars) to override config file values.
Trait Implementations§
Source§impl Clone for BenchmarkConfig
impl Clone for BenchmarkConfig
Source§fn clone(&self) -> BenchmarkConfig
fn clone(&self) -> BenchmarkConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BenchmarkConfig
impl Debug for BenchmarkConfig
Source§impl Default for BenchmarkConfig
impl Default for BenchmarkConfig
Source§fn default() -> BenchmarkConfig
fn default() -> BenchmarkConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BenchmarkConfig
impl<'de> Deserialize<'de> for BenchmarkConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BenchmarkConfig
impl RefUnwindSafe for BenchmarkConfig
impl Send for BenchmarkConfig
impl Sync for BenchmarkConfig
impl Unpin for BenchmarkConfig
impl UnwindSafe for BenchmarkConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more