pub struct TraceConfig { /* private fields */ }Expand description
How a harness traces. The environment overrides only the mode, output directory and size cap.
Implementations§
Source§impl TraceConfig
impl TraceConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
The defaults: TraceMode::OnFailure, target/icedwright, 64 MiB and a frame for
every step.
Sourcepub fn out_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn out_dir(self, dir: impl Into<PathBuf>) -> Self
The directory everything icedwright writes goes under.
Sourcepub fn max_size(self, bytes: ByteSize) -> Self
pub fn max_size(self, bytes: ByteSize) -> Self
The largest a trace file may be; frames are dropped to fit.
Sourcepub fn frames(self, policy: FramePolicy) -> Self
pub fn frames(self, policy: FramePolicy) -> Self
Which steps keep frames.
Sourcepub fn from_env(
self,
env: &impl Fn(&str) -> Option<String>,
) -> Result<Self, TraceError>
pub fn from_env( self, env: &impl Fn(&str) -> Option<String>, ) -> Result<Self, TraceError>
Applies ICEDWRIGHT_TRACE, ICEDWRIGHT_OUT_DIR and ICEDWRIGHT_TRACE_MAX_MB, read
through env, over this configuration.
Sourcepub fn trace_mode(&self) -> TraceMode
pub fn trace_mode(&self) -> TraceMode
When a trace file is written.
Sourcepub fn output_dir(&self) -> &Path
pub fn output_dir(&self) -> &Path
The output directory.
Sourcepub fn frame_policy(&self) -> FramePolicy
pub fn frame_policy(&self) -> FramePolicy
Which steps keep frames.
Sourcepub fn trace_path(&self, module_path: &str, test: &str) -> PathBuf
pub fn trace_path(&self, module_path: &str, test: &str) -> PathBuf
Where the trace of a test goes: <out>/traces/<crate>/<module path>/<test>.iwtrace,
with module_path as module_path!() prints it, crate first.
Trait Implementations§
Source§impl Clone for TraceConfig
impl Clone for TraceConfig
Source§impl Debug for TraceConfig
impl Debug for TraceConfig
Source§impl Default for TraceConfig
impl Default for TraceConfig
impl Eq for TraceConfig
Source§impl PartialEq for TraceConfig
impl PartialEq for TraceConfig
impl StructuralPartialEq for TraceConfig
Auto Trait Implementations§
impl Forget for TraceConfig
impl Freeze for TraceConfig
impl Move for TraceConfig
impl RefUnwindSafe for TraceConfig
impl Send for TraceConfigwhere
RawVecInner: Send,
impl Sync for TraceConfigwhere
RawVecInner: Sync,
impl Unpin for TraceConfig
impl UnsafeUnpin for TraceConfig
impl UnwindSafe for TraceConfigwhere
RawVecInner: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.