Struct raftify::HeedStorage
source · pub struct HeedStorage(/* private fields */);Implementations§
Trait Implementations§
source§impl Clone for HeedStorage
impl Clone for HeedStorage
source§fn clone(&self) -> HeedStorage
fn clone(&self) -> HeedStorage
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 HeedStorage
impl Debug for HeedStorage
source§impl LogStore for HeedStorage
impl LogStore for HeedStorage
fn compact(&mut self, index: u64) -> Result<()>
fn append(&mut self, entries: &[Entry]) -> Result<()>
fn hard_state(&self) -> Result<HardState>
fn set_hard_state(&mut self, hard_state: &HardState) -> Result<()>
fn set_hard_state_commit(&mut self, commit: u64) -> Result<()>
fn conf_state(&self) -> Result<ConfState>
fn set_conf_state(&mut self, conf_state: &ConfState) -> Result<()>
fn snapshot(&self, request_index: u64, to: u64) -> Result<Snapshot>
fn create_snapshot( &mut self, data: Vec<u8>, index: u64, term: u64 ) -> Result<()>
fn apply_snapshot(&mut self, snapshot: Snapshot) -> Result<()>
fn last_index(&self) -> Result<u64>
fn all_entries(&self) -> Result<Vec<Entry>>
source§impl Storage for HeedStorage
impl Storage for HeedStorage
source§fn initial_state(&self) -> Result<RaftState>
fn initial_state(&self) -> Result<RaftState>
initial_state is called when Raft is initialized. This interface will return a RaftState
which contains HardState and ConfState. Read moresource§fn entries(
&self,
low: u64,
high: u64,
max_size: impl Into<Option<u64>>,
ctx: GetEntriesContext
) -> Result<Vec<Entry>>
fn entries( &self, low: u64, high: u64, max_size: impl Into<Option<u64>>, ctx: GetEntriesContext ) -> Result<Vec<Entry>>
Returns a slice of log entries in the range
[low, high).
max_size limits the total size of the log entries returned if not None, however
the slice of entries returned will always have length at least 1 if entries are
found in the range. Read moresource§fn term(&self, idx: u64) -> Result<u64>
fn term(&self, idx: u64) -> Result<u64>
Returns the term of entry idx, which must be in the range
[first_index()-1, last_index()]. The term of the entry before
first_index is retained for matching purpose even though the
rest of that entry may not be available.
source§fn first_index(&self) -> Result<u64>
fn first_index(&self) -> Result<u64>
Returns the index of the first log entry that is possible available via entries, which will
always equal to
truncated index plus 1. Read moresource§fn last_index(&self) -> Result<u64>
fn last_index(&self) -> Result<u64>
The index of the last entry replicated in the
Storage.Auto Trait Implementations§
impl !RefUnwindSafe for HeedStorage
impl Send for HeedStorage
impl Sync for HeedStorage
impl Unpin for HeedStorage
impl !UnwindSafe for HeedStorage
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request