pub struct HttpConnection<C: RaftTypeConfig<NodeId = NodeId>> { /* private fields */ }Expand description
A single connection to a Raft peer.
Trait Implementations§
Source§impl<C> RaftNetwork<C> for HttpConnection<C>where
C: RaftTypeConfig<NodeId = NodeId, Node = BasicNode, SnapshotData = Cursor<Vec<u8>>>,
C::D: Serialize + DeserializeOwned,
C::R: Serialize + DeserializeOwned,
C::Entry: Serialize + DeserializeOwned,
impl<C> RaftNetwork<C> for HttpConnection<C>where
C: RaftTypeConfig<NodeId = NodeId, Node = BasicNode, SnapshotData = Cursor<Vec<u8>>>,
C::D: Serialize + DeserializeOwned,
C::R: Serialize + DeserializeOwned,
C::Entry: Serialize + DeserializeOwned,
Source§async fn append_entries(
&mut self,
rpc: AppendEntriesRequest<C>,
_option: RPCOption,
) -> Result<AppendEntriesResponse<NodeId>, RPCError<NodeId, BasicNode, RaftError<NodeId>>>
async fn append_entries( &mut self, rpc: AppendEntriesRequest<C>, _option: RPCOption, ) -> Result<AppendEntriesResponse<NodeId>, RPCError<NodeId, BasicNode, RaftError<NodeId>>>
Send an AppendEntries RPC to the target.
Source§async fn install_snapshot(
&mut self,
rpc: InstallSnapshotRequest<C>,
_option: RPCOption,
) -> Result<InstallSnapshotResponse<NodeId>, RPCError<NodeId, BasicNode, RaftError<NodeId, InstallSnapshotError>>>
async fn install_snapshot( &mut self, rpc: InstallSnapshotRequest<C>, _option: RPCOption, ) -> Result<InstallSnapshotResponse<NodeId>, RPCError<NodeId, BasicNode, RaftError<NodeId, InstallSnapshotError>>>
Send an InstallSnapshot RPC to the target.
Source§async fn vote(
&mut self,
rpc: VoteRequest<NodeId>,
_option: RPCOption,
) -> Result<VoteResponse<NodeId>, RPCError<NodeId, BasicNode, RaftError<NodeId>>>
async fn vote( &mut self, rpc: VoteRequest<NodeId>, _option: RPCOption, ) -> Result<VoteResponse<NodeId>, RPCError<NodeId, BasicNode, RaftError<NodeId>>>
Send a RequestVote RPC to the target.
Source§async fn full_snapshot(
&mut self,
vote: Vote<NodeId>,
snapshot: Snapshot<C>,
_cancel: impl Future<Output = ReplicationClosed> + OptionalSend + 'static,
_option: RPCOption,
) -> Result<SnapshotResponse<NodeId>, StreamingError<C, Fatal<NodeId>>>
async fn full_snapshot( &mut self, vote: Vote<NodeId>, snapshot: Snapshot<C>, _cancel: impl Future<Output = ReplicationClosed> + OptionalSend + 'static, _option: RPCOption, ) -> Result<SnapshotResponse<NodeId>, StreamingError<C, Fatal<NodeId>>>
Send a complete Snapshot to the target. Read more
Auto Trait Implementations§
impl<C> Freeze for HttpConnection<C>
impl<C> !RefUnwindSafe for HttpConnection<C>
impl<C> Send for HttpConnection<C>
impl<C> Sync for HttpConnection<C>
impl<C> Unpin for HttpConnection<C>where
C: Unpin,
impl<C> UnsafeUnpin for HttpConnection<C>
impl<C> !UnwindSafe for HttpConnection<C>
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