pub struct VectorLog { /* private fields */ }Expand description
An open, append-only vector log.
Implementations§
Source§impl VectorLog
impl VectorLog
Sourcepub fn open(path: &Path, cap: u64) -> Result<(Self, Vec<LogRecord>), OpenError>
pub fn open(path: &Path, cap: u64) -> Result<(Self, Vec<LogRecord>), OpenError>
Open (creating if absent) the log at path and return every record it
holds. A torn tail (a crash mid-append) is dropped and the file
truncated back to the last good frame. A complete frame that fails its
checksum is corruption: a warning with the dropped byte count is logged,
the dropped tail is first copied to <file>.corrupt.<unix ts>, and the
file is truncated so appends resume on a frame boundary. A file with
the wrong magic, or larger than cap, is OpenError::Corrupt and is
left untouched.
Sourcepub fn has_room_for(&self, records: &[LogRecord]) -> bool
pub fn has_room_for(&self, records: &[LogRecord]) -> bool
Whether a batch of records fits under the cap.
Auto Trait Implementations§
impl Freeze for VectorLog
impl RefUnwindSafe for VectorLog
impl Send for VectorLog
impl Sync for VectorLog
impl Unpin for VectorLog
impl UnsafeUnpin for VectorLog
impl UnwindSafe for VectorLog
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 more