Struct openraft_memstore::TypeConfig
source · pub struct TypeConfig {}
Expand description
Declare the type configuration for MemStore
.
Trait Implementations§
source§impl Clone for TypeConfig
impl Clone for TypeConfig
source§fn clone(&self) -> TypeConfig
fn clone(&self) -> TypeConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TypeConfig
impl Debug for TypeConfig
source§impl Default for TypeConfig
impl Default for TypeConfig
source§fn default() -> TypeConfig
fn default() -> TypeConfig
Returns the “default value” for a type. Read more
source§impl Ord for TypeConfig
impl Ord for TypeConfig
source§fn cmp(&self, other: &TypeConfig) -> Ordering
fn cmp(&self, other: &TypeConfig) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for TypeConfig
impl PartialEq for TypeConfig
source§fn eq(&self, other: &TypeConfig) -> bool
fn eq(&self, other: &TypeConfig) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TypeConfig
impl PartialOrd for TypeConfig
source§fn partial_cmp(&self, other: &TypeConfig) -> Option<Ordering>
fn partial_cmp(&self, other: &TypeConfig) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl RaftLogReader<TypeConfig> for Arc<MemStore>
impl RaftLogReader<TypeConfig> for Arc<MemStore>
source§async fn try_get_log_entries<RB: RangeBounds<u64> + Clone + Debug + OptionalSend>(
&mut self,
range: RB
) -> Result<Vec<Entry<TypeConfig>>, StorageError<MemNodeId>>
async fn try_get_log_entries<RB: RangeBounds<u64> + Clone + Debug + OptionalSend>( &mut self, range: RB ) -> Result<Vec<Entry<TypeConfig>>, StorageError<MemNodeId>>
Get a series of log entries from storage. Read more
source§impl RaftSnapshotBuilder<TypeConfig> for Arc<MemStore>
impl RaftSnapshotBuilder<TypeConfig> for Arc<MemStore>
source§async fn build_snapshot(
&mut self
) -> Result<Snapshot<TypeConfig>, StorageError<MemNodeId>>
async fn build_snapshot( &mut self ) -> Result<Snapshot<TypeConfig>, StorageError<MemNodeId>>
Build snapshot Read more
source§impl RaftStorage<TypeConfig> for Arc<MemStore>
impl RaftStorage<TypeConfig> for Arc<MemStore>
source§async fn get_log_state(
&mut self
) -> Result<LogState<TypeConfig>, StorageError<MemNodeId>>
async fn get_log_state( &mut self ) -> Result<LogState<TypeConfig>, StorageError<MemNodeId>>
Returns the last deleted log id and the last log id. Read more
source§async fn save_vote(
&mut self,
vote: &Vote<MemNodeId>
) -> Result<(), StorageError<MemNodeId>>
async fn save_vote( &mut self, vote: &Vote<MemNodeId> ) -> Result<(), StorageError<MemNodeId>>
To ensure correctness: the vote must be persisted on disk before returning.
async fn read_vote( &mut self ) -> Result<Option<Vote<MemNodeId>>, StorageError<MemNodeId>>
source§async fn save_committed(
&mut self,
committed: Option<LogId<MemNodeId>>
) -> Result<(), StorageError<MemNodeId>>
async fn save_committed( &mut self, committed: Option<LogId<MemNodeId>> ) -> Result<(), StorageError<MemNodeId>>
Saves the last committed log id to storage. Read more
source§async fn read_committed(
&mut self
) -> Result<Option<LogId<MemNodeId>>, StorageError<MemNodeId>>
async fn read_committed( &mut self ) -> Result<Option<LogId<MemNodeId>>, StorageError<MemNodeId>>
Return the last saved committed log id by
Self::save_committed
.source§async fn last_applied_state(
&mut self
) -> Result<(Option<LogId<MemNodeId>>, StoredMembership<MemNodeId, ()>), StorageError<MemNodeId>>
async fn last_applied_state( &mut self ) -> Result<(Option<LogId<MemNodeId>>, StoredMembership<MemNodeId, ()>), StorageError<MemNodeId>>
Returns the last applied log id which is recorded in state machine, and the last applied
membership config. Read more
source§async fn delete_conflict_logs_since(
&mut self,
log_id: LogId<MemNodeId>
) -> Result<(), StorageError<MemNodeId>>
async fn delete_conflict_logs_since( &mut self, log_id: LogId<MemNodeId> ) -> Result<(), StorageError<MemNodeId>>
Delete conflict log entries since
log_id
, inclusive. Read moresource§async fn purge_logs_upto(
&mut self,
log_id: LogId<MemNodeId>
) -> Result<(), StorageError<MemNodeId>>
async fn purge_logs_upto( &mut self, log_id: LogId<MemNodeId> ) -> Result<(), StorageError<MemNodeId>>
Delete applied log entries upto
log_id
, inclusive. Read moresource§async fn append_to_log<I>(
&mut self,
entries: I
) -> Result<(), StorageError<MemNodeId>>
async fn append_to_log<I>( &mut self, entries: I ) -> Result<(), StorageError<MemNodeId>>
Append a payload of entries to the log. Read more
source§async fn apply_to_state_machine(
&mut self,
entries: &[Entry<TypeConfig>]
) -> Result<Vec<ClientResponse>, StorageError<MemNodeId>>
async fn apply_to_state_machine( &mut self, entries: &[Entry<TypeConfig>] ) -> Result<Vec<ClientResponse>, StorageError<MemNodeId>>
Apply the given payload of entries to the state machine. Read more
source§async fn begin_receiving_snapshot(
&mut self
) -> Result<Box<<TypeConfig as RaftTypeConfig>::SnapshotData>, StorageError<MemNodeId>>
async fn begin_receiving_snapshot( &mut self ) -> Result<Box<<TypeConfig as RaftTypeConfig>::SnapshotData>, StorageError<MemNodeId>>
Create a new blank snapshot, returning a writable handle to the snapshot object. Read more
source§async fn install_snapshot(
&mut self,
meta: &SnapshotMeta<MemNodeId, ()>,
snapshot: Box<<TypeConfig as RaftTypeConfig>::SnapshotData>
) -> Result<(), StorageError<MemNodeId>>
async fn install_snapshot( &mut self, meta: &SnapshotMeta<MemNodeId, ()>, snapshot: Box<<TypeConfig as RaftTypeConfig>::SnapshotData> ) -> Result<(), StorageError<MemNodeId>>
Install a snapshot which has finished streaming from the leader. Read more
source§async fn get_current_snapshot(
&mut self
) -> Result<Option<Snapshot<TypeConfig>>, StorageError<MemNodeId>>
async fn get_current_snapshot( &mut self ) -> Result<Option<Snapshot<TypeConfig>>, StorageError<MemNodeId>>
Get a readable handle to the current snapshot, along with its metadata. Read more
§type SnapshotBuilder = Arc<MemStore>
type SnapshotBuilder = Arc<MemStore>
Snapshot builder type.
source§async fn get_log_reader(&mut self) -> Self::LogReader
async fn get_log_reader(&mut self) -> Self::LogReader
Get the log reader. Read more
source§async fn get_snapshot_builder(&mut self) -> Self::SnapshotBuilder
async fn get_snapshot_builder(&mut self) -> Self::SnapshotBuilder
Get the snapshot builder for the state machine. Read more
source§impl RaftTypeConfig for TypeConfig
impl RaftTypeConfig for TypeConfig
§type D = ClientRequest
type D = ClientRequest
Application-specific request data passed to the state machine.
§type R = ClientResponse
type R = ClientResponse
Application-specific response data returned by the state machine.
§type Entry = Entry<TypeConfig>
type Entry = Entry<TypeConfig>
Raft log entry, which can be built from an AppData.
§type SnapshotData = Cursor<Vec<u8>>
type SnapshotData = Cursor<Vec<u8>>
Snapshot data for exposing a snapshot for reading & writing. Read more
§type Responder = OneshotResponder<TypeConfig>
type Responder = OneshotResponder<TypeConfig>
Send the response or error of a client write request(
WriteResult
). Read more§type AsyncRuntime = TokioRuntime
type AsyncRuntime = TokioRuntime
Asynchronous runtime type.
impl Copy for TypeConfig
impl Eq for TypeConfig
impl StructuralPartialEq for TypeConfig
Auto Trait Implementations§
impl Freeze for TypeConfig
impl RefUnwindSafe for TypeConfig
impl Send for TypeConfig
impl Sync for TypeConfig
impl Unpin for TypeConfig
impl UnwindSafe for TypeConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more