pub struct Log { /* private fields */ }Implementations§
Source§impl Log
impl Log
pub fn open_default(path: &Path) -> Result<Self, Error>
pub fn open(path: &Path, options: Options) -> Result<Self, Error>
pub fn is_empty(&self) -> bool
pub fn last_data_off(&self) -> u64
pub fn repair(&self) -> Result<(), Error>
Sourcepub fn estimate(&mut self, data: &[u8]) -> u64
pub fn estimate(&mut self, data: &[u8]) -> u64
Estimate the file size after appending the data and flushing it
immediately.
Sourcepub fn append(&mut self, data: &[u8]) -> u64
pub fn append(&mut self, data: &[u8]) -> u64
Append data to the log’s buffer.
NOTE: flush() must be called to write buffered data to the disk.
pub fn read(&mut self, off: u64) -> Result<Chunk, Error>
Sourcepub fn flush(&mut self) -> Result<(), Error>
pub fn flush(&mut self) -> Result<(), Error>
Write buffered data to the disk, padding it appropriately.
pub fn iter(&mut self) -> Result<EntryIterator<'_>, Error>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Log
impl RefUnwindSafe for Log
impl Send for Log
impl Sync for Log
impl Unpin for Log
impl UnwindSafe for Log
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