pub enum ManagedEvent {
ReadyForContinue,
Paused(PausedEvent),
DiscoveryBatch(DiscoveryBatchEvent),
Slot(u64),
Status(BacktestStatus),
Completed {
summary: Option<SessionSummary>,
},
Error(BacktestError),
Transaction(Box<EncodedConfirmedTransactionWithStatusMeta>),
AccountDiff(AccountDiffNotification),
ActionResult(ActionResultNotification),
Diagnostic(DiagnosticNotification),
Replacement(Box<ReplacementNotification>),
}Expand description
An event from a managed session, returned by next_event.
One stream carries both the session control channel’s events and the notifications of every
subscribe_* call.
§Order
- Control events arrive in the order the server sent them, starting with
Statusupdates while the session starts. - Each subscription’s notifications arrive in order. Across subscriptions, and between
notifications and control events, there is no order: a
Transactioncan arrive after theSlotorReadyForContinuethat follows it. - Every notification arrives before
Completed: onCompleted, the session waits for each subscription to finish its stream. - After
Completed,next_eventreturnsManagedSessionError::ControlClosed. - If a subscription stops delivering before its stream ends,
next_eventreturns the notifications it has, thenManagedSessionError::SubscriptionFailedin place ofCompleted. - After a reconnect, a subscription sends the last slot it delivered again. Dedupe transactions by signature, and account diffs by (signature, account, slot).
Variants§
ReadyForContinue
The session is waiting for your next ManagedBacktestSession::send_continue or
ManagedBacktestSession::send_continue_to. Read and change state through the session’s
RPC endpoint now.
Paused(PausedEvent)
The session stopped where a send_continue_to asked. Read state now, but do not answer
it: a ReadyForContinue always follows, and that is the event to answer.
DiscoveryBatch(DiscoveryBatchEvent)
An upcoming batch matches a discovery filter from the create request. Send
send_continue_to(slot, batch_index) to pause just before it executes.
Slot(u64)
The slot that just executed. A skipped slot has no block and sends none.
Status(BacktestStatus)
A progress update, while the session starts and during each continue.
Completed
The session replayed its last slot. Every notification has arrived before this; the next
next_event returns ManagedSessionError::ControlClosed.
Fields
summary: Option<SessionSummary>None unless the session was created with send_summary.
Error(BacktestError)
The server reported an error. When BacktestError::is_terminal is true the session is
over: stop driving it. Otherwise it keeps running. Per-transaction SimulationErrors
never arrive here; they are logged.
Transaction(Box<EncodedConfirmedTransactionWithStatusMeta>)
From ManagedBacktestSession::subscribe_transactions: a transaction in the shape
getTransaction returns. Program logs are in meta.log_messages.
AccountDiff(AccountDiffNotification)
From ManagedBacktestSession::subscribe_account_diffs: one changed account.
ActionResult(ActionResultNotification)
From ManagedBacktestSession::subscribe_actions: the result of one pre-scheduled
action.
Diagnostic(DiagnosticNotification)
From ManagedBacktestSession::subscribe_diagnostics: one diagnostic probe sample.
Replacement(Box<ReplacementNotification>)
From ManagedBacktestSession::subscribe_replacements: one reroute result for an
original swap.
Trait Implementations§
Source§impl Debug for ManagedEvent
impl Debug for ManagedEvent
Source§impl From<ControlEvent> for ManagedEvent
impl From<ControlEvent> for ManagedEvent
Source§fn from(event: ControlEvent) -> Self
fn from(event: ControlEvent) -> Self
Source§impl From<SubscriptionNotification> for ManagedEvent
impl From<SubscriptionNotification> for ManagedEvent
Source§fn from(notification: SubscriptionNotification) -> Self
fn from(notification: SubscriptionNotification) -> Self
Auto Trait Implementations§
impl Forget for ManagedEvent
impl Freeze for ManagedEventwhere
*const u8 is !null: Freeze,
PhantomData<DiscoveryFilter>: Freeze,
PhantomData<EncodedBinary>: Freeze,
PhantomData<u32>: Freeze,
*const RerouteStatsReport is !null: Freeze,
PhantomData<RerouteStatsReport>: Freeze,
PhantomData<u8>: Freeze,
*const EncodedConfirmedTransactionWithStatusMeta is !null: Freeze,
PhantomData<EncodedConfirmedTransactionWithStatusMeta>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
PhantomData<ActionTransactionOutcome>: Freeze,
PhantomData<Option<Value>>: Freeze,
PhantomData<[String; 2]>: Freeze,
PhantomData<String>: Freeze,
*const ReplacementNotification is !null: Freeze,
PhantomData<ReplacementNotification>: Freeze,
impl Move for ManagedEvent
impl RefUnwindSafe for ManagedEvent
impl Send for ManagedEventwhere
RawVecInner: Send,
NodeRef<Owned, Address, SetValZST, LeafOrInternal>: Send,
BoxRaw<(Address, SetValZST)>: Send,
BoxRaw<RerouteStatsReport>: Send,
BoxRaw<EncodedConfirmedTransactionWithStatusMeta>: Send,
NodeRef<Owned, String, Value, LeafOrInternal>: Send,
BoxRaw<(String, Value)>: Send,
BoxRaw<ReplacementNotification>: Send,
impl Sync for ManagedEventwhere
RawVecInner: Sync,
NodeRef<Owned, Address, SetValZST, LeafOrInternal>: Sync,
BoxRaw<(Address, SetValZST)>: Sync,
BoxRaw<RerouteStatsReport>: Sync,
BoxRaw<EncodedConfirmedTransactionWithStatusMeta>: Sync,
NodeRef<Owned, String, Value, LeafOrInternal>: Sync,
BoxRaw<(String, Value)>: Sync,
BoxRaw<ReplacementNotification>: Sync,
impl Unpin for ManagedEventwhere
*const u8 is !null: Unpin,
*const LeafNode<Address, SetValZST> is !null: Unpin,
Box<(Address, SetValZST)>: Unpin,
Box<RerouteStatsReport>: Unpin,
Box<EncodedConfirmedTransactionWithStatusMeta>: Unpin,
*const LeafNode<String, Value> is !null: Unpin,
Box<(String, Value)>: Unpin,
Box<ReplacementNotification>: Unpin,
impl UnsafeUnpin for ManagedEventwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<DiscoveryFilter>: UnsafeUnpin,
PhantomData<EncodedBinary>: UnsafeUnpin,
PhantomData<u32>: UnsafeUnpin,
*const RerouteStatsReport is !null: UnsafeUnpin,
PhantomData<RerouteStatsReport>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const EncodedConfirmedTransactionWithStatusMeta is !null: UnsafeUnpin,
PhantomData<EncodedConfirmedTransactionWithStatusMeta>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
PhantomData<ActionTransactionOutcome>: UnsafeUnpin,
PhantomData<Option<Value>>: UnsafeUnpin,
PhantomData<[String; 2]>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
*const ReplacementNotification is !null: UnsafeUnpin,
PhantomData<ReplacementNotification>: UnsafeUnpin,
impl UnwindSafe for ManagedEventwhere
RawVecInner: UnwindSafe,
BTreeMap<Address, SetValZST>: UnwindSafe,
BoxRaw<RerouteStatsReport>: UnwindSafe,
BoxRaw<EncodedConfirmedTransactionWithStatusMeta>: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
BoxRaw<ReplacementNotification>: UnwindSafe,
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> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.