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>
impl<'a> EmittedEvent<'a>
Sourcepub fn payload(&self) -> Option<&'a [u8]>
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.
pub fn topic(&self, index: u32) -> Option<&'a [u8; 32]>
pub fn num_topics(&self) -> u32
Sourcepub fn raw(&self) -> &'a TxEmittedEvent
pub fn raw(&self) -> &'a TxEmittedEvent
Access the underlying raw event.
Trait Implementations§
Source§impl<'a> From<&'a TxEmittedEvent> for EmittedEvent<'a>
impl<'a> From<&'a TxEmittedEvent> for EmittedEvent<'a>
Source§fn from(event: &'a TxEmittedEvent) -> EmittedEvent<'a>
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> 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