pub struct EffectLedger { /* private fields */ }Expand description
Per-run store of effect records, their events, and replay cassettes.
Implementations§
Source§impl EffectLedger
impl EffectLedger
Sourcepub fn records(&self) -> &[EffectRecord]
pub fn records(&self) -> &[EffectRecord]
All effect records, in request order.
Sourcepub fn events(&self) -> &EventLedger
pub fn events(&self) -> &EventLedger
The underlying event ledger.
Sourcepub fn events_for_run(&self) -> &[Event]
pub fn events_for_run(&self) -> &[Event]
Events recorded for this ledger’s run, in order.
Sourcepub fn cassette_result(&self, key: &ContentId) -> Option<&Ref>
pub fn cassette_result(&self, key: &ContentId) -> Option<&Ref>
Recorded cassette result for replay key key, if any.
Sourcepub fn insert_cassette_result(&mut self, key: ContentId, result: Ref)
pub fn insert_cassette_result(&mut self, key: ContentId, result: Ref)
Record a cassette result for replay key key.
Sourcepub fn effect(&self, reference: &Ref) -> Option<&Effect>
pub fn effect(&self, reference: &Ref) -> Option<&Effect>
The effect recorded under reference, if any.
Sourcepub fn record_requested(
&mut self,
datum_store: &mut impl DatumStore,
effect: Effect,
) -> Result<EffectRecord>
pub fn record_requested( &mut self, datum_store: &mut impl DatumStore, effect: Effect, ) -> Result<EffectRecord>
Record an effect request, emitting an EventKind::EffectRequested
event and opening a new record.
Sourcepub fn record_resolved(
&mut self,
datum_store: &mut impl DatumStore,
effect: Ref,
result: Ref,
) -> Result<EffectRecord>
pub fn record_resolved( &mut self, datum_store: &mut impl DatumStore, effect: Ref, result: Ref, ) -> Result<EffectRecord>
Record an effect resolution, emitting an EventKind::EffectResolved
event and closing the open record with its result.
Sourcepub fn record_failed(
&mut self,
datum_store: &mut impl DatumStore,
effect: Ref,
error: Ref,
) -> Result<EffectRecord>
pub fn record_failed( &mut self, datum_store: &mut impl DatumStore, effect: Ref, error: Ref, ) -> Result<EffectRecord>
Record an effect failure, emitting an EventKind::Failed event and
marking the open record aborted.
Trait Implementations§
Source§impl Clone for EffectLedger
impl Clone for EffectLedger
Source§fn clone(&self) -> EffectLedger
fn clone(&self) -> EffectLedger
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 EffectLedger
impl Debug for EffectLedger
Auto Trait Implementations§
impl Freeze for EffectLedger
impl RefUnwindSafe for EffectLedger
impl Send for EffectLedger
impl Sync for EffectLedger
impl Unpin for EffectLedger
impl UnsafeUnpin for EffectLedger
impl UnwindSafe for EffectLedger
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