pub struct GraphRunRecorder { /* private fields */ }Expand description
Adapter that records graph lifecycle Events into a RunLedger.
Usage:
- Call
GraphRunRecorder::startto create a new run. - Call
GraphRunRecorder::recordfor each domain event. - Call
GraphRunRecorder::finish_okorGraphRunRecorder::finish_errto finalize.
Implementations§
Source§impl GraphRunRecorder
impl GraphRunRecorder
Sourcepub async fn start(
ledger: Arc<dyn RunLedger>,
spec_digest: &ContentDigest,
metadata: RunMetadata,
) -> StorageResult<Self>
pub async fn start( ledger: Arc<dyn RunLedger>, spec_digest: &ContentDigest, metadata: RunMetadata, ) -> StorageResult<Self>
Start a new run in the ledger, returning a recorder bound to that run.
Sourcepub async fn record(&self, event: &Event) -> StorageResult<()>
pub async fn record(&self, event: &Event) -> StorageResult<()>
Record a single domain event into the ledger.
Sourcepub async fn finish_ok(self, summary: RunSummary) -> StorageResult<()>
pub async fn finish_ok(self, summary: RunSummary) -> StorageResult<()>
Finalize the run as completed.
Sourcepub async fn finish_err(self, summary: RunSummary) -> StorageResult<()>
pub async fn finish_err(self, summary: RunSummary) -> StorageResult<()>
Finalize the run as failed.
Auto Trait Implementations§
impl Freeze for GraphRunRecorder
impl !RefUnwindSafe for GraphRunRecorder
impl Send for GraphRunRecorder
impl Sync for GraphRunRecorder
impl Unpin for GraphRunRecorder
impl UnsafeUnpin for GraphRunRecorder
impl !UnwindSafe for GraphRunRecorder
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> 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>
Converts
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>
Converts
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