[−][src]Struct raft::storage::MemStorageCore
The Memory Storage Core instance holds the actual state of the storage struct. To access this
value, use the rl
and wl
functions on the main MemStorage implementation.
Methods
impl MemStorageCore
[src]
pub fn set_hardstate(&mut self, hs: HardState)
[src]
Saves the current HardState.
pub fn set_conf_state(
&mut self,
cs: ConfState,
pending_membership_change: Option<(ConfState, u64)>
)
[src]
&mut self,
cs: ConfState,
pending_membership_change: Option<(ConfState, u64)>
)
Saves the current conf state.
pub fn apply_snapshot(&mut self, snapshot: Snapshot) -> Result<()>
[src]
Overwrites the contents of this Storage object with those of the given snapshot.
pub fn create_snapshot(
&mut self,
idx: u64,
cs: Option<ConfState>,
pending_membership_change: Option<ConfChange>,
data: Vec<u8>
) -> Result<&Snapshot>
[src]
&mut self,
idx: u64,
cs: Option<ConfState>,
pending_membership_change: Option<ConfChange>,
data: Vec<u8>
) -> Result<&Snapshot>
Makes a snapshot which can be retrieved with snapshot() and can be used to reconstruct the state at that point. If any configuration changes have been made since the last compaction, the result of the last apply_conf_change must be passed in.
pub fn compact(&mut self, compact_index: u64) -> Result<()>
[src]
Discards all log entries prior to compact_index. It is the application's responsibility to not attempt to compact an index greater than RaftLog.applied.
pub fn append(&mut self, ents: &[Entry]) -> Result<()>
[src]
Append the new entries to storage. TODO: ensure the entries are continuous and entries[0].get_index() > self.entries[0].get_index()
Trait Implementations
impl Default for MemStorageCore
[src]
fn default() -> MemStorageCore
[src]
Auto Trait Implementations
impl Send for MemStorageCore
impl Sync for MemStorageCore
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,