Struct snapps_txn_reference_impl::event::EventsHash [−][src]
pub struct EventsHash(pub Fp);
Expand description
A hash representing a list of events.
Tuple Fields
0: Fp
Implementations
The hash representing an empty list of events. Equivalent to
Hash::empty_events
wrapped by EventsHash
.
The hash formed by hash-consing event_hash
with events_hash
.
Creates a HashInput
formed by adding the events_hash
and
events_hash
field elements in order, then computing the
resulting hash with HashPrefixState::events_list
.
let mut hash_input = HashInput::empty();
HashInput::add_field(&mut hash_input, event_hash);
HashInput::add_field(&mut hash_input, events_hash.0);
EventsHash(Hash::compute_hash(
HashPrefixState::events_list(),
hash_input,
))
The hash formed by hash-consing event
’s hash with events_hash
.
Equivalent to calling EventsHash::push_event
on the result of
Event::hash
:
EventsHash::push_event_hash(Event::hash(event), events_hash)
Compute the hash of events
by starting with
empty
and calling
push_event
on each event in turn.
let mut events_hash = EventsHash::empty();
for event in events.iter() {
events_hash =
EventsHash::push_event(event, events_hash)
}
events_hash
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for EventsHash
impl Send for EventsHash
impl Sync for EventsHash
impl Unpin for EventsHash
impl UnwindSafe for EventsHash
Blanket Implementations
Mutably borrows from an owned value. Read more