Skip to main content

TraceOptions

Struct TraceOptions 

Source
#[non_exhaustive]
pub struct TraceOptions { pub timings: bool, pub changes: bool, pub redact: Vec<Path>, pub max_bytes: Option<usize>, }
Expand description

What a run’s trace records. A run is traced when RunOptions::trace is given these.

use dataflow_rs::observe::TraceOptions;

let opts = TraceOptions::default()
    .timings(true)
    .redact(vec!["data.card".parse().unwrap()])
    .max_bytes(1 << 20);
assert!(opts.changes && opts.timings);

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§timings: bool

Time each call, into its step’s elapsed. false by default: no clock is read for a trace without it.

§changes: bool

Record each step’s changes. true by default. A trace records its own changes whatever RunOptions::capture_changes says, which governs only the audit trail, so turning that off cannot empty a debugger’s replay. With false the steps carry statuses and timings, for profiling, and cannot be replayed.

§redact: Vec<Path>

Prefixes whose values read null in initial and in every change, applied as each is captured; the message keeps the real values. A change at or below one is recorded as a write of null at it, a removal’s included, so no key below it reaches the trace and a replay reads null there from the first write on. A path that resolves nothing in initial creates nothing there. Empty by default.

It masks values at those paths and nothing else: a step’s errors, like a value derived from a redacted one and written elsewhere, are carried as the message keeps them, so a record whose message quotes a redacted value quotes it in the trace too.

§max_bytes: Option<usize>

A ceiling on what the trace holds, on v3’s scale: one machine word per node, plus each string’s and each key’s length, counting initial and every change. The step that would cross it, and every later one, keeps everything but its changes, and Trace::truncated is set. None, the default, is unbounded.

Implementations§

Source§

impl TraceOptions

Source

pub fn timings(self, on: bool) -> Self

Times each call, or not.

Source

pub fn changes(self, on: bool) -> Self

Records each step’s changes, or not.

Source

pub fn redact(self, paths: Vec<Path>) -> Self

Redacts paths, as the redact field says.

Source

pub fn max_bytes(self, max: usize) -> Self

Bounds the trace at max bytes, as the max_bytes field says.

Trait Implementations§

Source§

impl Clone for TraceOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TraceOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TraceOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.