Struct raftify::HeedStorage

source ·
pub struct HeedStorage(/* private fields */);

Implementations§

source§

impl HeedStorage

source

pub fn create( log_dir_path: PathBuf, config: &Config, logger: Logger ) -> Result<Self>

Trait Implementations§

source§

impl Clone for HeedStorage

source§

fn clone(&self) -> HeedStorage

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for HeedStorage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl LogStore for HeedStorage

source§

fn compact(&mut self, index: u64) -> Result<()>

source§

fn append(&mut self, entries: &[Entry]) -> Result<()>

source§

fn hard_state(&self) -> Result<HardState>

source§

fn set_hard_state(&mut self, hard_state: &HardState) -> Result<()>

source§

fn set_hard_state_commit(&mut self, commit: u64) -> Result<()>

source§

fn conf_state(&self) -> Result<ConfState>

source§

fn set_conf_state(&mut self, conf_state: &ConfState) -> Result<()>

source§

fn snapshot(&self, request_index: u64, to: u64) -> Result<Snapshot>

source§

fn create_snapshot( &mut self, data: Vec<u8>, index: u64, term: u64 ) -> Result<()>

source§

fn apply_snapshot(&mut self, snapshot: Snapshot) -> Result<()>

source§

fn last_index(&self) -> Result<u64>

source§

fn all_entries(&self) -> Result<Vec<Entry>>

source§

impl Storage for HeedStorage

source§

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 more
source§

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 more
source§

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>

Returns the index of the first log entry that is possible available via entries, which will always equal to truncated index plus 1. Read more
source§

fn last_index(&self) -> Result<u64>

The index of the last entry replicated in the Storage.
source§

fn snapshot(&self, request_index: u64, to: u64) -> Result<Snapshot>

Returns the most recent snapshot. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more