Struct commitlog::CommitLog [−][src]
pub struct CommitLog { /* fields omitted */ }
Expand description
The commit log is an append-only sequence of messages.
Implementations
Creates or opens an existing commit log.
Appends a single message to the log, returning the offset appended.
pub fn append<T>(&mut self, buf: &mut T) -> Result<OffsetRange, AppendError> where
T: MessageSetMut,
pub fn append<T>(&mut self, buf: &mut T) -> Result<OffsetRange, AppendError> where
T: MessageSetMut,
Appends log entrites to the commit log, returning the offsets appended.
pub fn append_with_offsets<T>(
&mut self,
buf: &T
) -> Result<OffsetRange, AppendError> where
T: MessageSet,
pub fn append_with_offsets<T>(
&mut self,
buf: &T
) -> Result<OffsetRange, AppendError> where
T: MessageSet,
Appends log entrites to the commit log, returning the offsets appended.
The offsets are expected to already be set within the buffer.
Gets the last written offset.
Gets the latest offset
Reads a portion of the log, starting with the start
offset, inclusive,
up to the limit.
Reads a portion of the log, starting with the start
offset, inclusive,
up to the limit via the reader.
Truncates a file after the offset supplied. The resulting log will contain entries up to the offset.