pub struct LogCollection { /* private fields */ }Expand description
Append-only log collection.
Implementations§
Source§impl LogCollection
impl LogCollection
pub fn new(store: Arc<UnifiedStore>, config: LogCollectionConfig) -> Self
Sourcepub fn append(&self, fields: HashMap<String, Value>) -> LogId
pub fn append(&self, fields: HashMap<String, Value>) -> LogId
Append a single log entry. Returns the assigned ID.
Sourcepub fn append_fields(&self, fields: Vec<(&str, Value)>) -> LogId
pub fn append_fields(&self, fields: Vec<(&str, Value)>) -> LogId
Append a log entry from (key, value) pairs.
Sourcepub fn flush_buffer(&self)
pub fn flush_buffer(&self)
Flush the write buffer to storage.
Sourcepub fn range(&self, from_id: LogId, to_id: LogId, limit: usize) -> Vec<LogEntry>
pub fn range(&self, from_id: LogId, to_id: LogId, limit: usize) -> Vec<LogEntry>
Query entries within a time range (by ID boundaries).
Sourcepub fn apply_retention(&self) -> u64
pub fn apply_retention(&self) -> u64
Apply retention policy: delete entries older than the threshold.
Sourcepub fn config(&self) -> &LogCollectionConfig
pub fn config(&self) -> &LogCollectionConfig
Config reference.
Trait Implementations§
Source§impl Drop for LogCollection
impl Drop for LogCollection
Auto Trait Implementations§
impl !Freeze for LogCollection
impl !RefUnwindSafe for LogCollection
impl Send for LogCollection
impl Sync for LogCollection
impl Unpin for LogCollection
impl UnsafeUnpin for LogCollection
impl !UnwindSafe for LogCollection
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request