Struct commitlog::CommitLog
[−]
[src]
pub struct CommitLog { /* fields omitted */ }
The commit log is an append-only sequence of messages.
Methods
impl CommitLog
[src]
fn new(opts: LogOptions) -> Result<CommitLog>
Creates or opens an existing commit log.
fn append_msg<B: AsRef<[u8]>>(&mut self,
payload: B)
-> Result<Offset, AppendError>
payload: B)
-> Result<Offset, AppendError>
Appends a single message to the log, returning the offset appended.
fn append(&mut self, buf: &mut MessageBuf) -> Result<OffsetRange, AppendError>
Appends log entrites to the commit log, returning the offsets appended.
fn last_offset(&self) -> Option<Offset>
Gets the last written offset.
fn read(&mut self,
start: ReadPosition,
limit: ReadLimit)
-> Result<MessageSet, ReadError>
start: ReadPosition,
limit: ReadLimit)
-> Result<MessageSet, ReadError>
Reads a portion of the log, starting with the ReadPosition up to the limit.
fn flush(&mut self) -> Result<()>
Forces a flush of the log.