Enum UpdateStateError

Source
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 specific PartyStatusMismatch that caused the error.
§

BallotNumberMismatch(BallotNumberMismatch)

Occurs when there is a mismatch in the ballot number.

  • 0: The specific BallotNumberMismatch that caused the error.
§

LeaderMismatch(LeaderMismatch)

Occurs when there is a mismatch in the expected leader.

  • 0: The specific LeaderMismatch that caused the error.
§

ValueMismatch(ValueMismatch<V>)

Occurs when there is a mismatch in the expected value.

  • 0: The specific ValueMismatch<V> that caused the error, where V is 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 specific DeserializationError encountered.

Trait Implementations§

Source§

impl<V: Debug + Value> Debug for UpdateStateError<V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<V: Value> Display for UpdateStateError<V>

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<V: Value> Error for UpdateStateError<V>
where Self: Debug + Display,

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

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

Converts to this type from the input type.
Source§

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

Converts to this type from the input type.
Source§

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

Converts to this type from the input type.
Source§

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

Converts to this type from the input type.
Source§

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.

Source§

fn from(error: ValueMismatch<V>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<V> Freeze for UpdateStateError<V>
where V: Freeze,

§

impl<V> RefUnwindSafe for UpdateStateError<V>
where V: RefUnwindSafe,

§

impl<V> Send for UpdateStateError<V>
where V: Send,

§

impl<V> Sync for UpdateStateError<V>
where V: Sync,

§

impl<V> Unpin for UpdateStateError<V>
where V: Unpin,

§

impl<V> UnwindSafe for UpdateStateError<V>
where V: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<T> Error for T
where T: Error + 'static,

Source§

fn as_error(&self) -> &(dyn Error + 'static)

Gets this error as an std::error::Error.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V