[][src]Struct actix_raft::messages::ClientPayload

pub struct ClientPayload<D: AppData, R: AppDataResponse, E: AppError> { /* fields omitted */ }

A payload with an entry coming from a client request.

The entries of this payload will be appended to the Raft log and then applied to the Raft state machine according to the Raft protocol.

actix::Message

Applications using this Raft implementation are responsible for implementing the networking/transport layer which must move RPCs between nodes. Once the application instance recieves a Raft RPC, it must send the RPC to the Raft node via its actix::Addr and then return the response to the original sender.

The result type of calling the Raft actor with this message type is Result<ClientPayloadResponse, StorageError>. Applications built around this implementation of Raft will often need to perform their own custom logic in the storage layer and often times it is critical to be able to surface such errors to the application and its clients. To meet that end, ClientError allows for the communication of application specific errors.

Methods

impl<D: AppData, R: AppDataResponse, E: AppError> ClientPayload<D, R, E>[src]

pub fn new(entry: EntryNormal<D>, response_mode: ResponseMode) -> Self[src]

Create a new client payload instance with a normal entry type.

Trait Implementations

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

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

impl<D: AppData, R: AppDataResponse, E: AppError, N: RaftNetwork<D>, S: RaftStorage<D, R, E>> Handler<ClientPayload<D, R, E>> for Raft<D, R, E, N, S>[src]

type Result = ResponseActFuture<Self, ClientPayloadResponse<R>, ClientError<D, R, E>>

The type of value that this handler will return.

fn handle(
    &mut self,
    msg: ClientPayload<D, R, E>,
    _: &mut Self::Context
) -> Self::Result
[src]

Handle client requests.

impl<D: AppData, R: AppDataResponse, E: AppError> Message for ClientPayload<D, R, E>[src]

type Result = Result<ClientPayloadResponse<R>, ClientError<D, R, E>>

The result type of this message.

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

Auto Trait Implementations

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

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

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

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

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

Blanket Implementations

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

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<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[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>,