pub struct RaceContract {
pub candidates: Vec<Delegation>,
}Expand description
race — first completed candidate wins; losers are cancel-signalled
(R0.7 wave 3). Every candidate must declare a freely-repeatable effect:
a loser may be cancelled at any point, so any candidate that is not safe
to abandon makes the whole pattern unsafe. That is a submission-time
gate, not a runtime check — see RaceContract::validate.
Fields§
§candidates: Vec<Delegation>The candidates. Member names must be unique; every candidate’s
effect must satisfy Effect::is_freely_repeatable.
Implementations§
Source§impl RaceContract
impl RaceContract
Sourcepub fn validate(&self) -> Result<(), CoordinationViolation>
pub fn validate(&self) -> Result<(), CoordinationViolation>
The race effect gate, enforced at submission: every candidate must be
freely repeatable. This is the pattern’s whole safety argument — a
loser is cancel-signalled at an arbitrary point, so a candidate that
cannot be safely abandoned (a NonIdempotent charge, a
Compensatable write) must never enter a race.