pub struct HookContext {
pub kind: Option<BreakKind>,
pub duration_secs: Option<u64>,
pub outcome: Option<String>,
}Expand description
Per-call context populated by the scheduler. Fields show up as
$ENTRACTE_KIND, $ENTRACTE_DURATION_SECS, $ENTRACTE_OUTCOME
when the hook child runs; empty when not applicable to the event.
Fields§
§kind: Option<BreakKind>§duration_secs: Option<u64>§outcome: Option<String>Implementations§
Source§impl HookContext
impl HookContext
Sourcepub fn with_kind(kind: BreakKind) -> Self
pub fn with_kind(kind: BreakKind) -> Self
Carry just the break kind. Used for break_skipped / break_postponed.
Sourcepub fn with_kind_duration(kind: BreakKind, duration_secs: u64) -> Self
pub fn with_kind_duration(kind: BreakKind, duration_secs: u64) -> Self
Carry the break kind plus its scheduled duration. Used for
break_start.
Sourcepub fn with_kind_outcome(kind: BreakKind, outcome: impl Into<String>) -> Self
pub fn with_kind_outcome(kind: BreakKind, outcome: impl Into<String>) -> Self
Carry the break kind plus an outcome string
("completed" / "dismissed"). Used for break_end.
Trait Implementations§
Source§impl Clone for HookContext
impl Clone for HookContext
Source§fn clone(&self) -> HookContext
fn clone(&self) -> HookContext
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 HookContext
impl Debug for HookContext
Source§impl Default for HookContext
impl Default for HookContext
Source§fn default() -> HookContext
fn default() -> HookContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for HookContext
impl RefUnwindSafe for HookContext
impl Send for HookContext
impl Sync for HookContext
impl Unpin for HookContext
impl UnsafeUnpin for HookContext
impl UnwindSafe for HookContext
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.