Skip to main content

EmittedEvent

Struct EmittedEvent 

Source
pub struct EmittedEvent<'a>(/* private fields */);
Expand description

A view over a raw TxEmittedEvent providing typed access to topics and the XDR-encoded payload.

Implementations§

Source§

impl<'a> EmittedEvent<'a>

Source

pub fn payload(&self) -> Option<&'a [u8]>

The XDR-encoded payload (everything after the topics region), or None if the event is malformed (claims more topics than the protocol allows, or the claimed topics don’t fit in serialized_event).

Returning None rather than silently clamping to an empty slice keeps a corrupt event from decoding as a valid zero-field payload, and matches topic’s out-of-bounds behavior.

Source

pub fn topic(&self, index: u32) -> Option<&'a [u8; 32]>

Source

pub fn num_topics(&self) -> u32

Source

pub fn raw(&self) -> &'a TxEmittedEvent

Access the underlying raw event.

Trait Implementations§

Source§

impl<'a> From<&'a TxEmittedEvent> for EmittedEvent<'a>

Source§

fn from(event: &'a TxEmittedEvent) -> EmittedEvent<'a>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for EmittedEvent<'a>

§

impl<'a> RefUnwindSafe for EmittedEvent<'a>

§

impl<'a> Send for EmittedEvent<'a>

§

impl<'a> Sync for EmittedEvent<'a>

§

impl<'a> Unpin for EmittedEvent<'a>

§

impl<'a> UnsafeUnpin for EmittedEvent<'a>

§

impl<'a> UnwindSafe for EmittedEvent<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> StaticIfNoAlloc for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.