pub struct RaftLog<T: Types> { /* private fields */ }Implementations§
Source§impl<T: Types> RaftLog<T>
impl<T: Types> RaftLog<T>
pub fn dump(&self) -> RefDump<'_, T>
pub fn config(&self) -> &Config
pub fn open(config: Arc<Config>) -> Result<Self, Error>
pub fn load_chunk_ids(config: &Config) -> Result<Vec<ChunkId>, Error>
pub fn update_state(&mut self, state: RaftLogState<T>) -> Result<Segment, Error>
pub fn read( &self, from: u64, to: u64, ) -> impl Iterator<Item = Result<(T::LogId, T::LogPayload), Error>> + '_
pub fn log_state(&self) -> &RaftLogState<T>
pub fn access_stat(&self) -> &AccessStat
pub fn on_disk_size(&self) -> u64
Trait Implementations§
Source§impl<T: Types> RaftLogWriter<T> for RaftLog<T>
impl<T: Types> RaftLogWriter<T> for RaftLog<T>
Source§fn truncate(&mut self, index: u64) -> Result<Segment, Error>
fn truncate(&mut self, index: u64) -> Result<Segment, Error>
Truncate at index, keep the record before index.
Source§fn save_user_data(
&mut self,
user_data: Option<T::UserData>,
) -> Result<Segment, Error>
fn save_user_data( &mut self, user_data: Option<T::UserData>, ) -> Result<Segment, Error>
Update the Raft log state. Read more
Source§fn append<I>(&mut self, entries: I) -> Result<Segment, Error>
fn append<I>(&mut self, entries: I) -> Result<Segment, Error>
Append a batch of entries to the log. Read more
Source§fn purge(&mut self, upto: T::LogId) -> Result<Segment, Error>
fn purge(&mut self, upto: T::LogId) -> Result<Segment, Error>
Purge the log entries before and at the given log id. Read more
Auto Trait Implementations§
impl<T> Freeze for RaftLog<T>
impl<T> RefUnwindSafe for RaftLog<T>where
<T as Types>::Vote: RefUnwindSafe,
<T as Types>::LogId: RefUnwindSafe,
<T as Types>::UserData: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for RaftLog<T>
impl<T> Sync for RaftLog<T>
impl<T> Unpin for RaftLog<T>
impl<T> UnwindSafe for RaftLog<T>where
<T as Types>::LogId: RefUnwindSafe + UnwindSafe,
<T as Types>::Vote: UnwindSafe + RefUnwindSafe,
<T as Types>::UserData: UnwindSafe + RefUnwindSafe,
T: UnwindSafe + RefUnwindSafe,
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