Struct agreed_memstore::ClientRequest[][src]

pub struct ClientRequest {
    pub client: String,
    pub serial: u64,
    pub status: String,
}
Expand description

The application data request type which the MemStore works with.

Conceptually, for demo purposes, this represents an update to a client’s status info, returning the previously recorded status.

Fields

client: String

The ID of the client which has sent the request.

serial: u64

The serial number of this request.

status: String

A string describing the status of the client. For a real application, this should probably be an enum representing all of the various types of requests / operations which a client can perform.

Trait Implementations

impl Clone for ClientRequest[src]

fn clone(&self) -> ClientRequest[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for ClientRequest[src]

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

Formats the value using the given formatter. Read more

impl<'de> Deserialize<'de> for ClientRequest[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl RaftStorage<ClientRequest, ClientResponse> for MemStore[src]

type Snapshot = Cursor<Vec<u8>>

The storage engine’s associated type used for exposing a snapshot for reading & writing. Read more

type ShutdownError = ShutdownError

The error type used to indicate to Raft that shutdown is needed when calling the apply_entry_to_state_machine method. Read more

fn get_membership_config<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<MembershipConfig>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Get the latest membership config found in the log. Read more

fn get_initial_state<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<InitialState>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Get Raft’s state information from storage. Read more

fn save_hard_state<'life0, 'life1, 'async_trait>(
    &'life0 self,
    hs: &'life1 HardState
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Save Raft’s hard-state. Read more

fn get_log_entries<'life0, 'async_trait>(
    &'life0 self,
    start: u64,
    stop: u64
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry<ClientRequest>>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Get a series of log entries from storage. Read more

fn delete_logs_from<'life0, 'async_trait>(
    &'life0 self,
    start: u64,
    stop: Option<u64>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Delete all logs starting from start and stopping at stop, else continuing to the end of the log if stop is None. Read more

fn append_entry_to_log<'life0, 'life1, 'async_trait>(
    &'life0 self,
    entry: &'life1 Entry<ClientRequest>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Append a new entry to the log. Read more

fn replicate_to_log<'life0, 'life1, 'async_trait>(
    &'life0 self,
    entries: &'life1 [Entry<ClientRequest>]
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Replicate a payload of entries to the log. Read more

fn apply_entry_to_state_machine<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    index: &'life1 u64,
    data: &'life2 ClientRequest
) -> Pin<Box<dyn Future<Output = Result<ClientResponse>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 
[src]

Apply the given log entry to the state machine. Read more

fn replicate_to_state_machine<'life0, 'life1, 'life2, 'life3, 'async_trait>(
    &'life0 self,
    entries: &'life1 [(&'life2 u64, &'life3 ClientRequest)]
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    'life3: 'async_trait,
    Self: 'async_trait, 
[src]

Apply the given payload of entries to the state machine, as part of replication. Read more

fn do_log_compaction<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<CurrentSnapshotData<Self::Snapshot>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Perform log compaction, returning a handle to the generated snapshot. Read more

fn create_snapshot<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<(String, Box<Self::Snapshot>)>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Create a new blank snapshot, returning a writable handle to the snapshot object along with the ID of the snapshot. Read more

fn finalize_snapshot_installation<'life0, 'async_trait>(
    &'life0 self,
    index: u64,
    term: u64,
    delete_through: Option<u64>,
    id: String,
    snapshot: Box<Self::Snapshot>
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Finalize the installation of a snapshot which has finished streaming from the cluster leader. Read more

fn get_current_snapshot<'life0, 'async_trait>(
    &'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<CurrentSnapshotData<Self::Snapshot>>>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Get a readable handle to the current snapshot, along with its metadata. Read more

impl Serialize for ClientRequest[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl AppData for ClientRequest[src]

Auto Trait Implementations

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

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

Performs the conversion.

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.

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

Performs the conversion.

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

pub fn vzip(self) -> V

impl<T> WithSubscriber for T[src]

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
    S: Into<Dispatch>, 
[src]

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

fn with_current_subscriber(self) -> WithDispatch<Self>[src]

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

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