Struct diem_sdk::types::contract_event::EventWithProof [−][src]
pub struct EventWithProof<T> {
pub transaction_version: u64,
pub event_index: u64,
pub event: ContractEvent,
pub proof: EventProof<T>,
}
Fields
transaction_version: u64
event_index: u64
event: ContractEvent
proof: EventProof<T>
Implementations
pub fn new(
transaction_version: u64,
event_index: u64,
event: ContractEvent,
proof: EventProof<T>
) -> EventWithProof<T>
pub fn new(
transaction_version: u64,
event_index: u64,
event: ContractEvent,
proof: EventProof<T>
) -> EventWithProof<T>
Constructor.
Verifies the event with the proof, both carried by self
.
Two things are ensured if no error is raised:
- This event exists in the ledger represented by
ledger_info
. - And this event has the same
event_key
,sequence_number
,transaction_version
, andevent_index
as indicated in the parameter list. If any of these parameter is unknown to the call site and is supposed to be informed by this struct, get it from the struct itself, such as:event_with_proof.event.access_path()
,event_with_proof.event_index()
, etc.
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<EventWithProof<T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<EventWithProof<T>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'_> TryFrom<&'_ EventWithProof<TransactionInfo>> for EventWithProofView
impl<'_> TryFrom<&'_ EventWithProof<TransactionInfo>> for EventWithProofView
pub fn try_from(
event: &EventWithProof<TransactionInfo>
) -> Result<EventWithProofView, Error>
pub fn try_from(
event: &EventWithProof<TransactionInfo>
) -> Result<EventWithProofView, Error>
Performs the conversion.
impl<'_> TryFrom<&'_ EventWithProofView> for EventWithProof<TransactionInfo>
impl<'_> TryFrom<&'_ EventWithProofView> for EventWithProof<TransactionInfo>
pub fn try_from(
view: &EventWithProofView
) -> Result<EventWithProof<TransactionInfo>, Error>
pub fn try_from(
view: &EventWithProofView
) -> Result<EventWithProof<TransactionInfo>, Error>
Performs the conversion.
Auto Trait Implementations
impl<T> RefUnwindSafe for EventWithProof<T> where
T: RefUnwindSafe,
impl<T> Send for EventWithProof<T> where
T: Send,
impl<T> Sync for EventWithProof<T> where
T: Sync,
impl<T> Unpin for EventWithProof<T> where
T: Unpin,
impl<T> UnwindSafe for EventWithProof<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Generates a hash used only for tests.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more