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 duplicate 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§impl PartialOrd for TypeConfig
impl PartialOrd for TypeConfig
Source§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§fn limited_get_log_entries(
&mut self,
start: u64,
end: u64,
) -> impl Future<Output = Result<Vec<<C as RaftTypeConfig>::Entry>, StorageError<<C as RaftTypeConfig>::NodeId>>> + Send
fn limited_get_log_entries( &mut self, start: u64, end: u64, ) -> impl Future<Output = Result<Vec<<C as RaftTypeConfig>::Entry>, StorageError<<C as RaftTypeConfig>::NodeId>>> + Send
Returns log entries within range
[start, end), end is exclusive,
potentially limited by implementation-defined constraints. Read moreSource§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§type SnapshotBuilder = Arc<MemStore>
type SnapshotBuilder = Arc<MemStore>
Snapshot builder type.
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
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
Source§type D = ClientRequest
type D = ClientRequest
Application-specific request data passed to the state machine.
Source§type R = ClientResponse
type R = ClientResponse
Application-specific response data returned by the state machine.
Source§type Entry = Entry<TypeConfig>
type Entry = Entry<TypeConfig>
Raft log entry, which can be built from an AppData.
Source§type SnapshotData = Cursor<Vec<u8>>
type SnapshotData = Cursor<Vec<u8>>
Snapshot data for exposing a snapshot for reading & writing. Read more
Source§type Responder = OneshotResponder<TypeConfig>
type Responder = OneshotResponder<TypeConfig>
Send the response or error of a client write request(
WriteResult). Read moreSource§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> TypeConfigExt for Twhere
T: RaftTypeConfig,
impl<T> TypeConfigExt for Twhere
T: RaftTypeConfig,
Source§fn now() -> <Self::AsyncRuntime as AsyncRuntime>::Instant
fn now() -> <Self::AsyncRuntime as AsyncRuntime>::Instant
Returns the current time.
Source§fn sleep(duration: Duration) -> <Self::AsyncRuntime as AsyncRuntime>::Sleep
fn sleep(duration: Duration) -> <Self::AsyncRuntime as AsyncRuntime>::Sleep
Wait until
duration has elapsed.Source§fn sleep_until(
deadline: <Self::AsyncRuntime as AsyncRuntime>::Instant,
) -> <Self::AsyncRuntime as AsyncRuntime>::Sleep
fn sleep_until( deadline: <Self::AsyncRuntime as AsyncRuntime>::Instant, ) -> <Self::AsyncRuntime as AsyncRuntime>::Sleep
Wait until
deadline is reached.Source§fn timeout<R, F>(
duration: Duration,
future: F,
) -> <Self::AsyncRuntime as AsyncRuntime>::Timeout<R, F>where
F: Future<Output = R> + OptionalSend,
fn timeout<R, F>(
duration: Duration,
future: F,
) -> <Self::AsyncRuntime as AsyncRuntime>::Timeout<R, F>where
F: Future<Output = R> + OptionalSend,
Require a
Future to complete before the specified duration has elapsed.Source§fn timeout_at<R, F>(
deadline: <Self::AsyncRuntime as AsyncRuntime>::Instant,
future: F,
) -> <Self::AsyncRuntime as AsyncRuntime>::Timeout<R, F>where
F: Future<Output = R> + OptionalSend,
fn timeout_at<R, F>(
deadline: <Self::AsyncRuntime as AsyncRuntime>::Instant,
future: F,
) -> <Self::AsyncRuntime as AsyncRuntime>::Timeout<R, F>where
F: Future<Output = R> + OptionalSend,
Require a
Future to complete before the specified instant in time.Source§fn oneshot<T>() -> (<Self::AsyncRuntime as AsyncRuntime>::OneshotSender<T>, <Self::AsyncRuntime as AsyncRuntime>::OneshotReceiver<T>)where
T: OptionalSend,
fn oneshot<T>() -> (<Self::AsyncRuntime as AsyncRuntime>::OneshotSender<T>, <Self::AsyncRuntime as AsyncRuntime>::OneshotReceiver<T>)where
T: OptionalSend,
Creates a new one-shot channel for sending single values. Read more
Source§fn spawn<T>(
future: T,
) -> <Self::AsyncRuntime as AsyncRuntime>::JoinHandle<<T as Future>::Output>
fn spawn<T>( future: T, ) -> <Self::AsyncRuntime as AsyncRuntime>::JoinHandle<<T as Future>::Output>
Spawn a new task.