pub struct LogStore<D: Drain> { /* private fields */ }Expand description
A generic log data store that interacts with a log source via the Drain trait.
LogStore provides an interface to query log groups and records. It is generic
over D: Drain, meaning it can work with any concrete drain implementation
that provides log data (e.g., in-memory drains, file-based drains).
Log groups are fetched dynamically from the underlying drain when queried.
Implementations§
Source§impl<D: Drain> LogStore<D>
impl<D: Drain> LogStore<D>
Sourcepub fn get_log_group_by_id(&self, id: Uuid) -> Option<LogGroup>
pub fn get_log_group_by_id(&self, id: Uuid) -> Option<LogGroup>
Retrieves a specific LogGroup by its ID.
This method queries the underlying drain for all its log groups and then searches for the one with the matching ID.
§Arguments
id- TheUuidof theLogGroupto retrieve.
§Returns
An Option<LogGroup> containing the found log group, or None if no
group with the specified ID exists in the drain. The LogGroup is returned by value.
Sourcepub fn get_log_groups_in_range(
&self,
start_time: DateTime<Utc>,
end_time: DateTime<Utc>,
) -> Vec<LogGroup>
pub fn get_log_groups_in_range( &self, start_time: DateTime<Utc>, end_time: DateTime<Utc>, ) -> Vec<LogGroup>
Retrieves all LogGroups that fall within a specified time range.
This method queries the underlying drain for all its log groups and then filters them based on their timestamp.
§Arguments
start_time- TheDateTime<Utc>marking the beginning of the time range (inclusive).end_time- TheDateTime<Utc>marking the end of the time range (inclusive).
§Returns
A Vec<LogGroup> containing all log groups whose timestamp is within the
specified range. The LogGroups are returned by value.
Trait Implementations§
Auto Trait Implementations§
impl<D> Freeze for LogStore<D>where
D: Freeze,
impl<D> RefUnwindSafe for LogStore<D>where
D: RefUnwindSafe,
impl<D> Send for LogStore<D>where
D: Send,
impl<D> Sync for LogStore<D>where
D: Sync,
impl<D> Unpin for LogStore<D>where
D: Unpin,
impl<D> UnsafeUnpin for LogStore<D>where
D: UnsafeUnpin,
impl<D> UnwindSafe for LogStore<D>where
D: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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