rafted_value v0.1.1 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
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}
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.Croma.Integer.t, timer: Croma.TypeGen.Nilable.Croma.Reference.t, voted_for: Croma.TypeGen.Nilable.Croma.Pid.t, votes: Croma.TypeGen.Nilable.RaftedValue.PidSet.t}
Functions
Specs
gain_vote(RaftedValue.Election.t, RaftedValue.Members.t, pid) :: {t, boolean}
Specs
leader_message_at(t) :: Croma.TypeGen.Nilable.Croma.Integer.t
Type-aware getter for leader_message_at.
Type-aware setter for leader_message_at.
Specs
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
.
Specs
timer(t) :: Croma.TypeGen.Nilable.Croma.Reference.t
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
.
Specs
update_for_candidate(RaftedValue.Election.t, RaftedValue.Config.t) :: t
Specs
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
.
Specs
vote_for(RaftedValue.Election.t, pid, RaftedValue.Config.t) :: t
Specs
voted_for(t) :: Croma.TypeGen.Nilable.Croma.Pid.t
Type-aware getter for voted_for.
Type-aware setter for voted_for.
Specs
votes(t) :: Croma.TypeGen.Nilable.RaftedValue.PidSet.t
Type-aware getter for votes.