pub struct Log { /* private fields */ }Expand description
Universal log structure that works with different storage backends
Implementations§
Source§impl Log
impl Log
pub fn new(identifier: String, config: &LogConfig) -> Result<Self>
pub fn build_key_map(&mut self, config: &LogConfig) -> Result<(KeyMap, u64)>
pub fn write_entry(&mut self, key: &[u8], value: &[u8]) -> Result<WriteOutcome>
pub fn read_value(&mut self, offset: u64, len: u32) -> Result<Vec<u8>>
pub fn sync_all(&mut self) -> Result<()>
pub fn set_len(&mut self, size: u64) -> Result<()>
Sourcepub fn rename_to(&mut self, new_identifier: String) -> Result<()>
pub fn rename_to(&mut self, new_identifier: String) -> Result<()>
Atomically rename this log to a new identifier
Sourcepub fn current_size(&self) -> Result<u64>
pub fn current_size(&self) -> Result<u64>
Get current size of the log in bytes
Auto Trait Implementations§
impl Freeze for Log
impl RefUnwindSafe for Log
impl Send for Log
impl Sync for Log
impl Unpin for Log
impl UnsafeUnpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.