rafted_value v0.2.0 RaftedValue.Election
Summary
Functions
Type-aware getter for leader_message_at
Type-aware setter for leader_message_at
Creates a new instance of Elixir.RaftedValue.Election by using the given dict and the default value of each field.
Returns {:ok, valid_struct} or {:error, reason}.
The values in the dict are validated by each field’s validate/1 function
A variant of new/1 which returns t or raise if validation fails.
In other words, new/1 followed by Croma.Result.get!/1
Type-aware getter for timer
Type-aware setter for timer
Updates an existing instance of Elixir.RaftedValue.Election with the given dict.
The values in the dict are validated by each field’s validate/1 function.
Returns {:ok, valid_struct} or {:error, reason}
A variant of update/2 which returns t or raise if validation fails.
In other words, update/2 followed by Croma.Result.get!/1
Checks that the given dict is valid or not by using each field’s validate/1 function.
Returns {:ok, valid_struct} or {:error, reason}
A variant of validate/1 which returns t or raise if validation fails.
In other words, validate/1 followed by Croma.Result.get!/1
Type-aware getter for voted_for
Type-aware setter for voted_for
Type-aware getter for votes
Type-aware setter for votes
Types
t() :: %RaftedValue.Election{leader_message_at: Croma.TypeGen.Nilable.RaftedValue.Monotonic.t, timer: Croma.TypeGen.Nilable.Croma.Reference.t, voted_for: Croma.TypeGen.Nilable.Croma.Pid.t, votes: Croma.TypeGen.Nilable.RaftedValue.PidSet.t}
Functions
gain_vote(RaftedValue.Election.t, RaftedValue.Members.t, pid) :: {t, boolean}
Type-aware getter for leader_message_at.
minimum_timeout_elapsed_since_last_leader_message?(RaftedValue.Election.t, RaftedValue.Config.t) :: boolean
Creates a new instance of Elixir.RaftedValue.Election by using the given dict and the default value of each field.
Returns {:ok, valid_struct} or {:error, reason}.
The values in the dict are validated by each field’s validate/1 function.
A variant of new/1 which returns t or raise if validation fails.
In other words, new/1 followed by Croma.Result.get!/1.
Type-aware getter for timer.
Type-aware setter for timer.
Updates an existing instance of Elixir.RaftedValue.Election with the given dict.
The values in the dict are validated by each field’s validate/1 function.
Returns {:ok, valid_struct} or {:error, reason}.
A variant of update/2 which returns t or raise if validation fails.
In other words, update/2 followed by Croma.Result.get!/1.
update_for_candidate(RaftedValue.Election.t, RaftedValue.Config.t) :: t
update_for_follower(RaftedValue.Election.t, RaftedValue.Config.t) :: t
Checks that the given dict is valid or not by using each field’s validate/1 function.
Returns {:ok, valid_struct} or {:error, reason}.
A variant of validate/1 which returns t or raise if validation fails.
In other words, validate/1 followed by Croma.Result.get!/1.
Type-aware getter for voted_for.
Type-aware setter for voted_for.
Type-aware getter for votes.