Struct ac_node_api::events::RawEventDetails
source · pub struct RawEventDetails<Hash: Decode + Encode> { /* private fields */ }
Expand description
Raw event details without the associated metadata
Implementations§
source§impl<Hash: Encode + Decode> RawEventDetails<Hash>
impl<Hash: Encode + Decode> RawEventDetails<Hash>
sourcepub fn pallet_index(&self) -> u8
pub fn pallet_index(&self) -> u8
The index of the pallet that the event originated from.
sourcepub fn variant_index(&self) -> u8
pub fn variant_index(&self) -> u8
The index of the event variant that the event originated from.
sourcepub fn pallet_name(&self) -> &str
pub fn pallet_name(&self) -> &str
The name of the pallet from whence the Event originated.
sourcepub fn variant_name(&self) -> &str
pub fn variant_name(&self) -> &str
The name of the event (ie the name of the variant that it corresponds to).
sourcepub fn event_metadata<'a>(
&'a self,
metadata: &'a Metadata
) -> Result<EventMetadataDetails<'_>, Error>
pub fn event_metadata<'a>( &'a self, metadata: &'a Metadata ) -> Result<EventMetadataDetails<'_>, Error>
Fetch details from the metadata for this event.
sourcepub fn bytes(&self) -> &[u8] ⓘ
pub fn bytes(&self) -> &[u8] ⓘ
Return all of the bytes representing this event, which include, in order:
- The phase.
- Pallet and event index.
- Event fields.
- Event Topics.
sourcepub fn field_bytes(&self) -> &[u8] ⓘ
pub fn field_bytes(&self) -> &[u8] ⓘ
Return the bytes representing the fields stored in this event.
sourcepub fn field_values(
&self,
metadata: &Metadata
) -> Result<Composite<TypeId>, Error>
pub fn field_values( &self, metadata: &Metadata ) -> Result<Composite<TypeId>, Error>
Decode and provide the event fields back in the form of a scale_value::Composite
type which represents the named or unnamed fields that were present in the event.
sourcepub fn as_event<E: StaticEvent>(&self) -> Result<Option<E>, Error>
pub fn as_event<E: StaticEvent>(&self) -> Result<Option<E>, Error>
Attempt to decode these EventDetails
into a specific static event.
This targets the fields within the event directly. You can also attempt to
decode the entirety of the event type (including the pallet and event
variants) using EventDetails::as_root_event()
.
sourcepub fn as_root_event<E: RootEvent>(
&self,
metadata: &Metadata
) -> Result<E, Error>
pub fn as_root_event<E: RootEvent>( &self, metadata: &Metadata ) -> Result<E, Error>
Attempt to decode these EventDetails
into a root event type (which includes
the pallet and event enum variants as well as the event fields). A compatible
type for this is exposed via static codegen as a root level Event
type.
pub fn pallet_bytes(&self) -> &[u8] ⓘ
source§impl<Hash: Encode + Decode> RawEventDetails<Hash>
impl<Hash: Encode + Decode> RawEventDetails<Hash>
sourcepub fn has_failed(&self) -> bool
pub fn has_failed(&self) -> bool
Checks if the extrinsic has failed.
sourcepub fn get_associated_dispatch_error(
&self,
metadata: &Metadata
) -> Option<DispatchError>
pub fn get_associated_dispatch_error( &self, metadata: &Metadata ) -> Option<DispatchError>
Returns the dispatch error of the failed extrinsic, if it has failed.
sourcepub fn is_code_update(&self) -> bool
pub fn is_code_update(&self) -> bool
Checks if the event represents a code update (runtime update).
Trait Implementations§
source§impl<Hash: Clone + Decode + Encode> Clone for RawEventDetails<Hash>
impl<Hash: Clone + Decode + Encode> Clone for RawEventDetails<Hash>
source§fn clone(&self) -> RawEventDetails<Hash>
fn clone(&self) -> RawEventDetails<Hash>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<Hash: Decode + Encode> Decode for RawEventDetails<Hash>
impl<Hash: Decode + Encode> Decode for RawEventDetails<Hash>
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
source§impl<Hash: Decode + Encode> Encode for RawEventDetails<Hash>
impl<Hash: Decode + Encode> Encode for RawEventDetails<Hash>
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl<Hash: Encode + Decode> From<EventDetails<Hash>> for RawEventDetails<Hash>
impl<Hash: Encode + Decode> From<EventDetails<Hash>> for RawEventDetails<Hash>
source§fn from(val: EventDetails<Hash>) -> Self
fn from(val: EventDetails<Hash>) -> Self
source§impl<Hash: PartialEq + Decode + Encode> PartialEq for RawEventDetails<Hash>
impl<Hash: PartialEq + Decode + Encode> PartialEq for RawEventDetails<Hash>
source§fn eq(&self, other: &RawEventDetails<Hash>) -> bool
fn eq(&self, other: &RawEventDetails<Hash>) -> bool
self
and other
values to be equal, and is used
by ==
.impl<Hash: Decode + Encode> EncodeLike for RawEventDetails<Hash>
impl<Hash: Decode + Encode> StructuralPartialEq for RawEventDetails<Hash>
Auto Trait Implementations§
impl<Hash> RefUnwindSafe for RawEventDetails<Hash>where
Hash: RefUnwindSafe,
impl<Hash> Send for RawEventDetails<Hash>where
Hash: Send,
impl<Hash> Sync for RawEventDetails<Hash>where
Hash: Sync,
impl<Hash> Unpin for RawEventDetails<Hash>where
Hash: Unpin,
impl<Hash> UnwindSafe for RawEventDetails<Hash>where
Hash: 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
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§impl<T> Conv for T
impl<T> Conv for T
source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
§impl<T> FmtForward for T
impl<T> FmtForward for T
§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.§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.§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.§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.§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.§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.§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.§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.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§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 more§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 more§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
§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
§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.§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.§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.§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read more§impl<T> Tap for T
impl<T> Tap for T
§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 more§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 more§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 more§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 more§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 more§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 more§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.§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.§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.§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.§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.§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.§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.§impl<T> TryConv for T
impl<T> TryConv for T
source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.