pub enum BenchInit {
Disabled,
Enabled(BenchSession),
}Expand description
Result of environment-driven benchmark initialization.
§Examples
use ailloli_ui_bench::BenchInit;
let init = BenchInit::Disabled;
assert!(init.path().is_none());Variants§
Disabled
Benchmark collection was not requested.
Enabled(BenchSession)
Benchmark collection is active. Keep the session alive for the whole run.
Implementations§
Source§impl BenchInit
impl BenchInit
Sourcepub fn finish(self) -> Result<Option<CompletedRun>, BenchWriteError>
pub fn finish(self) -> Result<Option<CompletedRun>, BenchWriteError>
Sourcepub fn path(&self) -> Option<&Path>
pub fn path(&self) -> Option<&Path>
Returns the final output path when collection is enabled.
§Examples
use ailloli_ui_bench::BenchInit;
assert!(BenchInit::Disabled.path().is_none());Sourcepub fn session(&self) -> Option<&BenchSession>
pub fn session(&self) -> Option<&BenchSession>
Borrows the active session when collection is enabled.
§Examples
use ailloli_ui_bench::BenchInit;
assert!(BenchInit::Disabled.session().is_none());Trait Implementations§
Auto Trait Implementations§
impl Freeze for BenchInit
impl !RefUnwindSafe for BenchInit
impl Send for BenchInit
impl Sync for BenchInit
impl Unpin for BenchInit
impl !UnwindSafe for BenchInit
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