pub struct LedgerHandler<L: RunLedger> { /* private fields */ }Expand description
Implements oxidizedgraph’s EventHandler to persist graph lifecycle
events into an AIVCS RunLedger.
The handler:
- Creates a run on
on_start() - Maps each
Eventto aRunEventand appends it onhandle() - Completes or fails the run on
on_stop()based on whether errors occurred
Implementations§
Source§impl<L: RunLedger> LedgerHandler<L>
impl<L: RunLedger> LedgerHandler<L>
Sourcepub fn new(
ledger: Arc<L>,
spec_digest: ContentDigest,
metadata: RunMetadata,
) -> Self
pub fn new( ledger: Arc<L>, spec_digest: ContentDigest, metadata: RunMetadata, ) -> Self
Create a new handler that will persist events to the given ledger.
Trait Implementations§
Source§impl<L: RunLedger + 'static> EventHandler for LedgerHandler<L>
impl<L: RunLedger + 'static> EventHandler for LedgerHandler<L>
Source§fn on_start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_start<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called when the handler is started
Auto Trait Implementations§
impl<L> !Freeze for LedgerHandler<L>
impl<L> !RefUnwindSafe for LedgerHandler<L>
impl<L> Send for LedgerHandler<L>
impl<L> Sync for LedgerHandler<L>
impl<L> Unpin for LedgerHandler<L>
impl<L> UnsafeUnpin for LedgerHandler<L>
impl<L> !UnwindSafe for LedgerHandler<L>
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