Struct openraft_memstore::ClientRequest
source · [−]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
sourceimpl Clone for ClientRequest
impl Clone for ClientRequest
sourcefn clone(&self) -> ClientRequest
fn clone(&self) -> ClientRequest
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ClientRequest
impl Debug for ClientRequest
sourceimpl<'de> Deserialize<'de> for ClientRequest
impl<'de> Deserialize<'de> for ClientRequest
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl RaftStorage<ClientRequest, ClientResponse> for MemStore
impl RaftStorage<ClientRequest, ClientResponse> for MemStore
type SnapshotData = Cursor<Vec<u8, Global>>
type SnapshotData = Cursor<Vec<u8, Global>>
The storage engine’s associated type used for exposing a snapshot for reading & writing. Read more
sourcefn get_membership_config<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<EffectiveMembership, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn get_membership_config<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<EffectiveMembership, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Get the latest membership config found in the log or in state machine. Read more
sourcefn get_initial_state<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<InitialState, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn get_initial_state<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<InitialState, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Get Raft’s state information from storage. Read more
sourcefn save_hard_state<'life0, 'life1, 'async_trait>(
&'life0 self,
hs: &'life1 HardState
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn save_hard_state<'life0, 'life1, 'async_trait>(
&'life0 self,
hs: &'life1 HardState
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Save Raft’s hard-state. Read more
fn read_hard_state<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<HardState>, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
sourcefn get_log_entries<'life0, 'async_trait, RNG>(
&'life0 self,
range: RNG
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry<ClientRequest>>, StorageError>> + Send + 'async_trait>> where
RNG: 'async_trait + RangeBounds<u64> + Clone + Debug + Send + Sync,
'life0: 'async_trait,
Self: 'async_trait,
fn get_log_entries<'life0, 'async_trait, RNG>(
&'life0 self,
range: RNG
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry<ClientRequest>>, StorageError>> + Send + 'async_trait>> where
RNG: 'async_trait + RangeBounds<u64> + Clone + Debug + Send + Sync,
'life0: 'async_trait,
Self: 'async_trait,
Get a series of log entries from storage. Read more
sourcefn try_get_log_entries<'life0, 'async_trait, RNG>(
&'life0 self,
range: RNG
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry<ClientRequest>>, StorageError>> + Send + 'async_trait>> where
RNG: 'async_trait + RangeBounds<u64> + Clone + Debug + Send + Sync,
'life0: 'async_trait,
Self: 'async_trait,
fn try_get_log_entries<'life0, 'async_trait, RNG>(
&'life0 self,
range: RNG
) -> Pin<Box<dyn Future<Output = Result<Vec<Entry<ClientRequest>>, StorageError>> + Send + 'async_trait>> where
RNG: 'async_trait + RangeBounds<u64> + Clone + Debug + Send + Sync,
'life0: 'async_trait,
Self: 'async_trait,
Get a series of log entries from storage. Read more
sourcefn try_get_log_entry<'life0, 'async_trait>(
&'life0 self,
log_index: u64
) -> Pin<Box<dyn Future<Output = Result<Option<Entry<ClientRequest>>, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn try_get_log_entry<'life0, 'async_trait>(
&'life0 self,
log_index: u64
) -> Pin<Box<dyn Future<Output = Result<Option<Entry<ClientRequest>>, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Try to get an log entry.
It does not return an error if in defensive mode and the log entry at log_index
is not found. Read more
sourcefn first_id_in_log<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<LogId>, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn first_id_in_log<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<LogId>, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns the first log id in log. Read more
fn first_known_log_id<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<LogId, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
sourcefn last_id_in_log<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<LogId, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn last_id_in_log<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<LogId, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns the last log id in log. Read more
sourcefn last_applied_state<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(LogId, Option<EffectiveMembership>), StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn last_applied_state<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(LogId, Option<EffectiveMembership>), StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns the last applied log id which is recorded in state machine, and the last applied membership log id and membership config. Read more
sourcefn delete_logs_from<'life0, 'async_trait, R>(
&'life0 self,
range: R
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>> where
R: 'async_trait + RangeBounds<u64> + Clone + Debug + Send + Sync,
'life0: 'async_trait,
Self: 'async_trait,
fn delete_logs_from<'life0, 'async_trait, R>(
&'life0 self,
range: R
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>> where
R: 'async_trait + RangeBounds<u64> + Clone + Debug + Send + Sync,
'life0: 'async_trait,
Self: 'async_trait,
Delete all logs in a range
.
sourcefn append_to_log<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
entries: &'life1 [&'life2 Entry<ClientRequest>]
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn append_to_log<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
entries: &'life1 [&'life2 Entry<ClientRequest>]
) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Append a payload of entries to the log. Read more
sourcefn apply_to_state_machine<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
entries: &'life1 [&'life2 Entry<ClientRequest>]
) -> Pin<Box<dyn Future<Output = Result<Vec<ClientResponse>, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn apply_to_state_machine<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
entries: &'life1 [&'life2 Entry<ClientRequest>]
) -> Pin<Box<dyn Future<Output = Result<Vec<ClientResponse>, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Apply the given payload of entries to the state machine. Read more
sourcefn do_log_compaction<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Snapshot<Self::SnapshotData>, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn do_log_compaction<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Snapshot<Self::SnapshotData>, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Build snapshot Read more
sourcefn begin_receiving_snapshot<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Box<Self::SnapshotData>, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn begin_receiving_snapshot<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Box<Self::SnapshotData>, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Create a new blank snapshot, returning a writable handle to the snapshot object. Read more
sourcefn finalize_snapshot_installation<'life0, 'life1, 'async_trait>(
&'life0 self,
meta: &'life1 SnapshotMeta,
snapshot: Box<Self::SnapshotData>
) -> Pin<Box<dyn Future<Output = Result<StateMachineChanges, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn finalize_snapshot_installation<'life0, 'life1, 'async_trait>(
&'life0 self,
meta: &'life1 SnapshotMeta,
snapshot: Box<Self::SnapshotData>
) -> Pin<Box<dyn Future<Output = Result<StateMachineChanges, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Install a snapshot which has finished streaming from the cluster leader. Read more
sourcefn get_current_snapshot<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<Snapshot<Self::SnapshotData>>, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn get_current_snapshot<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<Snapshot<Self::SnapshotData>>, StorageError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Get a readable handle to the current snapshot, along with its metadata. Read more
sourceimpl Serialize for ClientRequest
impl Serialize for ClientRequest
impl AppData for ClientRequest
Auto Trait Implementations
impl RefUnwindSafe for ClientRequest
impl Send for ClientRequest
impl Sync for ClientRequest
impl Unpin for ClientRequest
impl UnwindSafe for ClientRequest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more