pub struct EffectRecord {Show 16 fields
pub published: Option<ToolResultContext>,
pub id: EffectId,
pub key: HandlerKey,
pub kind: EffectKind,
pub outcome: Result<Answered, ErrorReport>,
pub events: Option<StreamRecord>,
pub stream_origin: Option<Origin>,
pub parent: Option<EffectId>,
pub scope: Option<Arc<str>>,
pub purpose: Option<Cow<'static, str>>,
pub turn: Option<u64>,
pub started_ms: Option<u64>,
pub finished_ms: Option<u64>,
pub reviewed: Option<Result<Answered, ErrorReport>>,
pub disposition: Disposition,
pub decided_by: Option<Decider>,
}Expand description
One recorded exchange: the effect, who served it, and the answer.
Fields§
§published: Option<ToolResultContext>Explicitly published result metadata, including on errors: a
tool’s, or the facts any layer of the dispatch published
(PublishedContext). Never
inbound authentication values or runtime scopes. None means nothing
was published before resolving; the wire field is required, and
null records that nothing was published.
id: EffectIdThe dispatch’s id.
key: HandlerKeyThe handler the effect was routed to.
kind: EffectKindThe effect.
outcome: Result<Answered, ErrorReport>The answer.
events: Option<StreamRecord>A streamed dispatch’s items, verbatim, when the recorder was asked
to keep them (EffectLogRecorder::keeping_stream_events); None
otherwise, and the answer is the fold. A replayer re-emits these
when present, so a replayed consumer sees the original fragment
boundaries. They read back through StreamRecord::parse_prefix.
stream_origin: Option<Origin>Who a streamed dispatch’s reply was from, as its relay stated it before the first item, when the items are kept. A replayer sends it first, so a replayed stream cut short knows its origin.
parent: Option<EffectId>Parent dispatch for a nested handler call, or None for a root dispatch.
scope: Option<Arc<str>>Stable identifier of the dispatching program or run, not a runtime handle.
None when the dispatcher supplied no scope.
purpose: Option<Cow<'static, str>>What the dispatcher made the effect for, such as "turn" or
"compaction", from its DispatchContext. None when
it named no purpose.
turn: Option<u64>The turn of its dispatcher’s conversation it was made in, as the
host numbers turns (the first is 0). None when the host keeps no
turns or it belongs to none, such as a call made between turns.
started_ms: Option<u64>When a handler started serving it, in milliseconds since the Unix
epoch. None when no handler started it (it was answered before it
started), or when the recorder keeps no times.
finished_ms: Option<u64>When its outcome was known, in milliseconds since the Unix epoch.
None when the recorder keeps no times.
reviewed: Option<Result<Answered, ErrorReport>>The outcome a reviewer put in place of Self::outcome, which stays
the handler’s (or the early answer’s) own. None when nothing
replaced it. A replayer answers with Self::outcome and lets the
reviewers run again, as it reruns layers.
disposition: DispositionHow the outcome came about.
decided_by: Option<Decider>Who decided the answer before it ran, when a decision answered it.
None when its handler or its owner answered it: an effect no gate
decided ran, and an allow is not a decision.
Implementations§
Source§impl EffectRecord
impl EffectRecord
Sourcepub fn new(
id: EffectId,
key: HandlerKey,
kind: EffectKind,
outcome: Result<Answered, ErrorReport>,
) -> Self
pub fn new( id: EffectId, key: HandlerKey, kind: EffectKind, outcome: Result<Answered, ErrorReport>, ) -> Self
The record of effect id, kind, routed to key and answered with
outcome, and nothing else known: no parent, scope, purpose, turn, times,
tool output, kept items, review or decider, and Disposition::Ran. A host
that answers or cancels an effect itself builds its record from this
and sets what it knows.
Trait Implementations§
Source§impl Clone for EffectRecord
impl Clone for EffectRecord
Source§impl Debug for EffectRecord
impl Debug for EffectRecord
Source§impl<'de> Deserialize<'de> for EffectRecord
impl<'de> Deserialize<'de> for EffectRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl !RefUnwindSafe for EffectRecord
impl !UnwindSafe for EffectRecord
impl Freeze for EffectRecord
impl Send for EffectRecord
impl Sync for EffectRecord
impl Unpin for EffectRecord
impl UnsafeUnpin for EffectRecord
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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