pub struct Event {
pub package_id: Address,
pub module: Identifier,
pub sender: Address,
pub type_: StructTag,
pub contents: Vec<u8>,
}Expand description
An event
§BCS
The BCS serialized form for this type is defined by the following ABNF:
event = address identifier address struct-tag bytesFields§
§package_id: AddressPackage id of the top-level function invoked by a MoveCall command which triggered this event to be emitted.
module: IdentifierModule name of the top-level function invoked by a MoveCall command which triggered this event to be emitted.
sender: AddressAddress of the account that sent the transaction where this event was emitted.
type_: StructTagThe type of the event emitted
contents: Vec<u8>BCS serialized bytes of the event
Implementations§
Source§impl Event
impl Event
Sourcepub fn digest(&self) -> Digest
Available on crate features hash and serde only.
pub fn digest(&self) -> Digest
hash and serde only.Per-event digest used as the leaf input for authenticated event stream commitments.
Unlike the TransactionEvents digest above, this is not
salted with the type name: the framework computes it as the bare
BLAKE2b-256 over the BCS-encoded Event. Two events with
identical contents share a digest; their merkle leaves remain
distinct because the surrounding EventCommitment also pins each
event to its (checkpoint_seq, transaction_idx, event_idx)
position.
Trait Implementations§
Source§impl Arbitrary for Event
impl Arbitrary for Event
Source§type Parameters = ()
type Parameters = ()
arbitrary_with accepts for configuration
of the generated Strategy. Parameters must implement Default.Source§type Strategy = BoxedStrategy<Event>
type Strategy = BoxedStrategy<Event>
Strategy used to generate values of type Self.Source§fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
fn arbitrary_with(args: <Self as Arbitrary>::Parameters) -> Self::Strategy
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl !Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, T> FromBcs for Twhere
T: Deserialize<'de>,
impl<'de, T> FromBcs for Twhere
T: Deserialize<'de>,
Source§fn from_bcs<'de>(bytes: &'de [u8]) -> Result<Self, Error>where
Self: Deserialize<'de>,
fn from_bcs<'de>(bytes: &'de [u8]) -> Result<Self, Error>where
Self: Deserialize<'de>,
serde only.Source§fn from_bcs_base64(base64: &str) -> Result<Self, Error>where
Self: DeserializeOwned,
fn from_bcs_base64(base64: &str) -> Result<Self, Error>where
Self: DeserializeOwned,
serde only.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 more