Skip to main content

Crate election

Crate election 

Source
Expand description

Elections that arbitrate a setting across multiple voters.

Each voter casts or withdraws its vote in its own K slot of an Election, which elects the winning value (the result):

Election holds its internal lock only for short map reads and writes, never across .await points. Callers that need to update several Elections and apply the results as a single transaction must serialize those updates themselves.

Structs§

Election
An election for one setting: tracks per-voter (K) votes for a value of type V and elects the winning value (the result).

Traits§

InspectValue
Records a vote or result onto an Inspect fuchsia_inspect::Node under key.