pub enum UpdateStateError<V: Value> {
PartyStatusMismatch(PartyStatusMismatch),
BallotNumberMismatch(BallotNumberMismatch),
LeaderMismatch(LeaderMismatch),
ValueMismatch(ValueMismatch<V>),
ValueVerificationFailed,
DeserializationError(DeserializationError),
}Expand description
Represents the various errors that can occur when updating the state in a consensus protocol.
This enum is generic over V, which must implement the Value trait.
Variants§
PartyStatusMismatch(PartyStatusMismatch)
Occurs when there is a mismatch in the expected party status.
0: The specificPartyStatusMismatchthat caused the error.
BallotNumberMismatch(BallotNumberMismatch)
Occurs when there is a mismatch in the ballot number.
0: The specificBallotNumberMismatchthat caused the error.
LeaderMismatch(LeaderMismatch)
Occurs when there is a mismatch in the expected leader.
0: The specificLeaderMismatchthat caused the error.
ValueMismatch(ValueMismatch<V>)
Occurs when there is a mismatch in the expected value.
0: The specificValueMismatch<V>that caused the error, whereVis the type of the value.
ValueVerificationFailed
Occurs when the value verification fails during the state update process.
DeserializationError(DeserializationError)
Occurs when there is an error during deserialization.
0: The specificDeserializationErrorencountered.
Trait Implementations§
Source§impl<V: Value> Display for UpdateStateError<V>where
ValueMismatch<V>: Display,
impl<V: Value> Display for UpdateStateError<V>where
ValueMismatch<V>: Display,
Source§impl<V: Value> Error for UpdateStateError<V>
impl<V: Value> Error for UpdateStateError<V>
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl<V: Value> From<BallotNumberMismatch> for UpdateStateError<V>
Converts a BallotNumberMismatch into an UpdateStateError<V>.
impl<V: Value> From<BallotNumberMismatch> for UpdateStateError<V>
Converts a BallotNumberMismatch into an UpdateStateError<V>.
This conversion is used when there is a ballot number mismatch during state updates,
allowing the error to be propagated and handled as an UpdateStateError.
Source§fn from(error: BallotNumberMismatch) -> Self
fn from(error: BallotNumberMismatch) -> Self
Source§impl<V: Value> From<DeserializationError> for UpdateStateError<V>
Converts a DeserializationError into an UpdateStateError<V>.
impl<V: Value> From<DeserializationError> for UpdateStateError<V>
Converts a DeserializationError into an UpdateStateError<V>.
This conversion is used when a deserialization error occurs during state updates, allowing the error to be handled within the context of state updates.
Source§fn from(error: DeserializationError) -> Self
fn from(error: DeserializationError) -> Self
Source§impl<V: Value> From<LeaderMismatch> for UpdateStateError<V>
Converts a LeaderMismatch into an UpdateStateError<V>.
impl<V: Value> From<LeaderMismatch> for UpdateStateError<V>
Converts a LeaderMismatch into an UpdateStateError<V>.
This conversion is used when there is a leader mismatch during state updates,
allowing the error to be propagated and handled as an UpdateStateError.
Source§fn from(error: LeaderMismatch) -> Self
fn from(error: LeaderMismatch) -> Self
Source§impl<V: Value> From<PartyStatusMismatch> for UpdateStateError<V>
Converts a PartyStatusMismatch into an UpdateStateError<V>.
impl<V: Value> From<PartyStatusMismatch> for UpdateStateError<V>
Converts a PartyStatusMismatch into an UpdateStateError<V>.
This conversion is useful when a status mismatch occurs while updating the state, allowing the error to be handled within the context of state updates.
Source§fn from(error: PartyStatusMismatch) -> Self
fn from(error: PartyStatusMismatch) -> Self
Source§impl<V: Value> From<ValueMismatch<V>> for UpdateStateError<V>
Converts a ValueMismatch<V> into an UpdateStateError<V>.
impl<V: Value> From<ValueMismatch<V>> for UpdateStateError<V>
Converts a ValueMismatch<V> into an UpdateStateError<V>.
This conversion is used when there is a value mismatch during state updates,
allowing the error to be propagated and handled as an UpdateStateError.