[][src]Enum actix_raft::messages::ClientError

pub enum ClientError<D: AppData, R: AppDataResponse, E: AppError> {
    Internal,
    Application(E),
    ForwardToLeader {
        payload: ClientPayload<D, R, E>,
        leader: Option<NodeId>,
    },
}

Error variants which may arise while handling client requests.

Variants

Internal

Some error which has taken place internally in Raft.

Application(E)

An application specific error.

ForwardToLeader

The Raft node returning this error is not the Raft leader.

Forward the payload to the specified leader. If the leader is unknown, it is up to the application to determine how to handle. The payload can be buffered in the app until the new leader is known, or it can be returned to the client as an error and the client can be instructed to send to a new random node until the leader is known.

The process of electing a new leader is usually a very fast process in Raft, so buffering the client payload until the new leader is known should not cause a lot of overhead.

Fields of ForwardToLeader

payload: ClientPayload<D, R, E>

The original payload which this error is associated with.

leader: Option<NodeId>

The ID of the current Raft leader, if known.

Trait Implementations

impl<D: Debug + AppData, R: Debug + AppDataResponse, E: Debug + AppError> Debug for ClientError<D, R, E>[src]

impl<'de, D: AppData, R: AppDataResponse, E: AppError> Deserialize<'de> for ClientError<D, R, E> where
    E: AppError,
    D: AppData,
    R: AppDataResponse,
    E: AppError
[src]

impl<D: AppData, R: AppDataResponse, E: AppError> Display for ClientError<D, R, E>[src]

impl<D: AppData, R: AppDataResponse, E: AppError> Error for ClientError<D, R, E>[src]

impl<D: AppData, R: AppDataResponse, E: AppError> Serialize for ClientError<D, R, E> where
    E: AppError,
    D: AppData,
    R: AppDataResponse,
    E: AppError
[src]

Auto Trait Implementations

impl<D, R, E> RefUnwindSafe for ClientError<D, R, E> where
    D: RefUnwindSafe,
    E: RefUnwindSafe,
    R: RefUnwindSafe

impl<D, R, E> Send for ClientError<D, R, E>

impl<D, R, E> Sync for ClientError<D, R, E>

impl<D, R, E> Unpin for ClientError<D, R, E> where
    D: Unpin,
    E: Unpin,
    R: Unpin

impl<D, R, E> UnwindSafe for ClientError<D, R, E> where
    D: UnwindSafe,
    E: UnwindSafe,
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsFail for T where
    T: Fail, 

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<E> Fail for E where
    E: 'static + Error + Send + Sync

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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