pub struct CommandTrace { /* private fields */ }Expand description
Mutable trace builder for a single CLI command invocation.
Construction starts the clock; calling CommandTrace::ok or
CommandTrace::err emits the line and consumes the value.
The builder fields are accumulated as the command progresses and figures out what it’s doing (browser resolution, route selection, tab binding). Anything not set defaults to an empty string in the emitted log line so the schema is stable.
Implementations§
Source§impl CommandTrace
impl CommandTrace
Sourcepub fn new(command: &'static str) -> Self
pub fn new(command: &'static str) -> Self
Start a trace. The clock starts here. command is the static
command name ("eval", "fetch", "tab-open", …) — keep it
kebab-cased so log consumers can match on a stable string.
pub fn browser(&mut self, s: impl Into<String>) -> &mut Self
pub fn engine(&mut self, e: Engine) -> &mut Self
Sourcepub fn route(&mut self, r: &'static str) -> &mut Self
pub fn route(&mut self, r: &'static str) -> &mut Self
Set the routing path. Suggested values:
"scratch"— scratch-tab recovery wrapper"named-tab"—<browser>/<tab>via tabs registry"target-regex"— legacy--target <regex>selector"attach-for-origin"— fetch default (origin-matched tab)"direct"— external URL fall-through"registry"— registry-only ops (cookies, wait, etc.)
pub fn tab_name(&mut self, s: impl Into<String>) -> &mut Self
pub fn target_id(&mut self, s: impl Into<String>) -> &mut Self
Sourcepub fn ok<T>(self, val: T) -> T
pub fn ok<T>(self, val: T) -> T
Emit the closing log line with outcome=ok and return val
unchanged. Use at the success exit of every command:
Ok(trace.ok(value)).
Auto Trait Implementations§
impl Freeze for CommandTrace
impl RefUnwindSafe for CommandTrace
impl Send for CommandTrace
impl Sync for CommandTrace
impl Unpin for CommandTrace
impl UnsafeUnpin for CommandTrace
impl UnwindSafe for CommandTrace
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more