pub struct TypeConfig { /* private fields */ }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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for TypeConfig
Source§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
impl Eq for TypeConfig
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 (const: unstable) · 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
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for TypeConfig
impl PartialOrd for TypeConfig
Source§impl RaftLogReader<TypeConfig> for LogStorage<TypeConfig>
impl RaftLogReader<TypeConfig> for LogStorage<TypeConfig>
Source§async fn try_get_log_entries<RB: RangeBounds<u64> + Clone + Debug + OptionalSend>(
&mut self,
range: RB,
) -> Result<Vec<<TypeConfig as RaftTypeConfig>::Entry>, StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
async fn try_get_log_entries<RB: RangeBounds<u64> + Clone + Debug + OptionalSend>( &mut self, range: RB, ) -> Result<Vec<<TypeConfig as RaftTypeConfig>::Entry>, StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
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 RaftLogStorage<TypeConfig> for LogStorage<TypeConfig>
impl RaftLogStorage<TypeConfig> for LogStorage<TypeConfig>
Source§type LogReader = LogStorage
type LogReader = LogStorage
Log reader type. Read more
Source§async fn append<I>(
&mut self,
entries: I,
callback: LogFlushed<TypeConfig>,
) -> Result<(), StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>where
I: IntoIterator<Item = <TypeConfig as RaftTypeConfig>::Entry> + OptionalSend,
I::IntoIter: OptionalSend,
async fn append<I>(
&mut self,
entries: I,
callback: LogFlushed<TypeConfig>,
) -> Result<(), StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>where
I: IntoIterator<Item = <TypeConfig as RaftTypeConfig>::Entry> + OptionalSend,
I::IntoIter: OptionalSend,
Append log entries and call the
callback once logs are persisted on disk. Read moreSource§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_log_state(
&mut self,
) -> Result<LogState<TypeConfig>, StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
async fn get_log_state( &mut self, ) -> Result<LogState<TypeConfig>, StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
Returns the last deleted log id and the last log id. Read more
Source§async fn purge(
&mut self,
log_id: LogId<<TypeConfig as RaftTypeConfig>::NodeId>,
) -> Result<(), StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
async fn purge( &mut self, log_id: LogId<<TypeConfig as RaftTypeConfig>::NodeId>, ) -> Result<(), StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
Purge logs upto
log_id, inclusive Read moreSource§async fn read_committed(
&mut self,
) -> Result<Option<LogId<<TypeConfig as RaftTypeConfig>::NodeId>>, StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
async fn read_committed( &mut self, ) -> Result<Option<LogId<<TypeConfig as RaftTypeConfig>::NodeId>>, StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
Return the last saved committed log id by
Self::save_committed.Source§async fn save_committed(
&mut self,
committed: Option<LogId<<TypeConfig as RaftTypeConfig>::NodeId>>,
) -> Result<(), StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
async fn save_committed( &mut self, committed: Option<LogId<<TypeConfig as RaftTypeConfig>::NodeId>>, ) -> Result<(), StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
Saves the last committed log id to storage. Read more
Source§async fn read_vote(
&mut self,
) -> Result<Option<Vote<<TypeConfig as RaftTypeConfig>::NodeId>>, StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
async fn read_vote( &mut self, ) -> Result<Option<Vote<<TypeConfig as RaftTypeConfig>::NodeId>>, StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
Return the last saved vote by
Self::save_vote.Source§async fn save_vote(
&mut self,
vote: &Vote<<TypeConfig as RaftTypeConfig>::NodeId>,
) -> Result<(), StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
async fn save_vote( &mut self, vote: &Vote<<TypeConfig as RaftTypeConfig>::NodeId>, ) -> Result<(), StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
Save vote to storage. Read more
Source§async fn truncate(
&mut self,
log_id: LogId<<TypeConfig as RaftTypeConfig>::NodeId>,
) -> Result<(), StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
async fn truncate( &mut self, log_id: LogId<<TypeConfig as RaftTypeConfig>::NodeId>, ) -> Result<(), StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
Truncate logs since
log_id, inclusive Read moreSource§impl RaftNetwork<TypeConfig> for TcpNetwork
impl RaftNetwork<TypeConfig> for TcpNetwork
Source§async fn vote(
&mut self,
rpc: VoteRequest<<TypeConfig as RaftTypeConfig>::NodeId>,
_option: RPCOption,
) -> Result<VoteResponse<<TypeConfig as RaftTypeConfig>::NodeId>, RPCError<<TypeConfig as RaftTypeConfig>::NodeId, <TypeConfig as RaftTypeConfig>::Node, RaftError<<TypeConfig as RaftTypeConfig>::NodeId>>>
async fn vote( &mut self, rpc: VoteRequest<<TypeConfig as RaftTypeConfig>::NodeId>, _option: RPCOption, ) -> Result<VoteResponse<<TypeConfig as RaftTypeConfig>::NodeId>, RPCError<<TypeConfig as RaftTypeConfig>::NodeId, <TypeConfig as RaftTypeConfig>::Node, RaftError<<TypeConfig as RaftTypeConfig>::NodeId>>>
Send a RequestVote RPC to the target.
Source§async fn append_entries(
&mut self,
rpc: AppendEntriesRequest<TypeConfig>,
_option: RPCOption,
) -> Result<AppendEntriesResponse<<TypeConfig as RaftTypeConfig>::NodeId>, RPCError<<TypeConfig as RaftTypeConfig>::NodeId, <TypeConfig as RaftTypeConfig>::Node, RaftError<<TypeConfig as RaftTypeConfig>::NodeId>>>
async fn append_entries( &mut self, rpc: AppendEntriesRequest<TypeConfig>, _option: RPCOption, ) -> Result<AppendEntriesResponse<<TypeConfig as RaftTypeConfig>::NodeId>, RPCError<<TypeConfig as RaftTypeConfig>::NodeId, <TypeConfig as RaftTypeConfig>::Node, RaftError<<TypeConfig as RaftTypeConfig>::NodeId>>>
Send an AppendEntries RPC to the target.
Source§async fn install_snapshot(
&mut self,
rpc: InstallSnapshotRequest<TypeConfig>,
_option: RPCOption,
) -> Result<InstallSnapshotResponse<<TypeConfig as RaftTypeConfig>::NodeId>, RPCError<<TypeConfig as RaftTypeConfig>::NodeId, <TypeConfig as RaftTypeConfig>::Node, RaftError<<TypeConfig as RaftTypeConfig>::NodeId, InstallSnapshotError>>>
async fn install_snapshot( &mut self, rpc: InstallSnapshotRequest<TypeConfig>, _option: RPCOption, ) -> Result<InstallSnapshotResponse<<TypeConfig as RaftTypeConfig>::NodeId>, RPCError<<TypeConfig as RaftTypeConfig>::NodeId, <TypeConfig as RaftTypeConfig>::Node, RaftError<<TypeConfig as RaftTypeConfig>::NodeId, InstallSnapshotError>>>
Send an InstallSnapshot RPC to the target.
Source§fn full_snapshot(
&mut self,
vote: Vote<<C as RaftTypeConfig>::NodeId>,
snapshot: Snapshot<C>,
cancel: impl Future<Output = ReplicationClosed> + OptionalSend + 'static,
option: RPCOption,
) -> impl Future<Output = Result<SnapshotResponse<<C as RaftTypeConfig>::NodeId>, StreamingError<C, Fatal<<C as RaftTypeConfig>::NodeId>>>> + Send
fn full_snapshot( &mut self, vote: Vote<<C as RaftTypeConfig>::NodeId>, snapshot: Snapshot<C>, cancel: impl Future<Output = ReplicationClosed> + OptionalSend + 'static, option: RPCOption, ) -> impl Future<Output = Result<SnapshotResponse<<C as RaftTypeConfig>::NodeId>, StreamingError<C, Fatal<<C as RaftTypeConfig>::NodeId>>>> + Send
Send a complete Snapshot to the target. Read more
Source§impl RaftNetworkFactory<TypeConfig> for TcpNetworkService
impl RaftNetworkFactory<TypeConfig> for TcpNetworkService
Source§type Network = TcpNetwork
type Network = TcpNetwork
Actual type of the network handling a single connection.
Source§async fn new_client(
&mut self,
target: <TypeConfig as RaftTypeConfig>::NodeId,
node: &<TypeConfig as RaftTypeConfig>::Node,
) -> Self::Network
async fn new_client( &mut self, target: <TypeConfig as RaftTypeConfig>::NodeId, node: &<TypeConfig as RaftTypeConfig>::Node, ) -> Self::Network
Create a new network instance sending RPCs to the target node. Read more
Source§impl RaftSnapshotBuilder<TypeConfig> for Arc<StateMachineStore>
impl RaftSnapshotBuilder<TypeConfig> for Arc<StateMachineStore>
Source§async fn build_snapshot(
&mut self,
) -> Result<Snapshot<TypeConfig>, StorageError<NodeId>>
async fn build_snapshot( &mut self, ) -> Result<Snapshot<TypeConfig>, StorageError<NodeId>>
Build snapshot Read more
Source§impl RaftStateMachine<TypeConfig> for Arc<StateMachineStore>
impl RaftStateMachine<TypeConfig> for Arc<StateMachineStore>
Source§type SnapshotBuilder = Arc<StateMachineStore>
type SnapshotBuilder = Arc<StateMachineStore>
Snapshot builder type.
Source§async fn applied_state(
&mut self,
) -> Result<(Option<LogId<<TypeConfig as RaftTypeConfig>::NodeId>>, StoredMembership<<TypeConfig as RaftTypeConfig>::NodeId, <TypeConfig as RaftTypeConfig>::Node>), StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
async fn applied_state( &mut self, ) -> Result<(Option<LogId<<TypeConfig as RaftTypeConfig>::NodeId>>, StoredMembership<<TypeConfig as RaftTypeConfig>::NodeId, <TypeConfig as RaftTypeConfig>::Node>), StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
Returns the last applied log id which is recorded in state machine, and the last applied
membership config. Read more
Source§async fn apply<I>(
&mut self,
entries: I,
) -> Result<Vec<<TypeConfig as RaftTypeConfig>::R>, StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>where
I: IntoIterator<Item = <TypeConfig as RaftTypeConfig>::Entry> + OptionalSend,
I::IntoIter: OptionalSend,
async fn apply<I>(
&mut self,
entries: I,
) -> Result<Vec<<TypeConfig as RaftTypeConfig>::R>, StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>where
I: IntoIterator<Item = <TypeConfig as RaftTypeConfig>::Entry> + OptionalSend,
I::IntoIter: OptionalSend,
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<<TypeConfig as RaftTypeConfig>::NodeId>>
async fn begin_receiving_snapshot( &mut self, ) -> Result<Box<<TypeConfig as RaftTypeConfig>::SnapshotData>, StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
Create a new blank snapshot, returning a writable handle to the snapshot object. Read more
Source§async fn get_current_snapshot(
&mut self,
) -> Result<Option<Snapshot<TypeConfig>>, StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
async fn get_current_snapshot( &mut self, ) -> Result<Option<Snapshot<TypeConfig>>, StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
Get a readable handle to the current snapshot. 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§async fn install_snapshot(
&mut self,
meta: &SnapshotMeta<<TypeConfig as RaftTypeConfig>::NodeId, <TypeConfig as RaftTypeConfig>::Node>,
snapshot: Box<<TypeConfig as RaftTypeConfig>::SnapshotData>,
) -> Result<(), StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
async fn install_snapshot( &mut self, meta: &SnapshotMeta<<TypeConfig as RaftTypeConfig>::NodeId, <TypeConfig as RaftTypeConfig>::Node>, snapshot: Box<<TypeConfig as RaftTypeConfig>::SnapshotData>, ) -> Result<(), StorageError<<TypeConfig as RaftTypeConfig>::NodeId>>
Install a snapshot which has finished streaming from the leader. Read more
Source§impl RaftTypeConfig for TypeConfig
impl RaftTypeConfig for TypeConfig
Source§type R = RaftResponse
type R = RaftResponse
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 AsyncRuntime = TokioRuntime
type AsyncRuntime = TokioRuntime
Asynchronous runtime type.
Source§type Responder = OneshotResponder<TypeConfig>
type Responder = OneshotResponder<TypeConfig>
Send the response or error of a client write request(
WriteResult). Read moreimpl 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 UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
impl<T> OptionalSend for T
impl<T> OptionalSync for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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.