pub enum SubmissionOutcome {
Emit(SubmissionEvent),
EmitAndFinish(SubmissionEvent),
Fail(NodeClientError),
}Expand description
Result of translating a single TxStatus against a running submission.
SubmissionOutcome::Emitproduces aSubmissionEventand the stream should keep going (forReady/Future/Broadcast/RetractedandInBlock).SubmissionOutcome::EmitAndFinishemits a final event and the stream should end (forFinalized).SubmissionOutcome::Failproduces a terminal error and the stream ends (forFinalityTimeout/Usurped/Dropped/Invalid).
Variants§
Implementations§
Source§impl SubmissionOutcome
impl SubmissionOutcome
Sourcepub fn from_status(status: TxStatus, tx: &[u8], tx_hash: &str) -> Self
pub fn from_status(status: TxStatus, tx: &[u8], tx_hash: &str) -> Self
Translate a single Substrate status into either an event or a terminal error. Takes ownership of the status and copies of the tx bytes and tx hash so the resulting event can live past the status.
§Behavior
Mirrors PolkadotNodeClient.ts:#handleSubmissionResult. In particular:
RetractedemitsSubmitted(not an error) — the tx is back in the pool and can still land. The TS code does the same.FinalizedemitsFinalizedand ends the stream (EmitAndFinish) — subsequent statuses from the same subscription are not delivered.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SubmissionOutcome
impl !UnwindSafe for SubmissionOutcome
impl Forget for SubmissionOutcome
impl Freeze for SubmissionOutcome
impl Move for SubmissionOutcome
impl Send for SubmissionOutcome
impl Sync for SubmissionOutcome
impl Unpin for SubmissionOutcome
impl UnsafeUnpin for SubmissionOutcomewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const dyn Error + Sync + Send is !null: UnsafeUnpin,
PhantomData<dyn Error + Sync + Send>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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