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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.