pub struct LogStore { /* private fields */ }Expand description
Log store for persisting logs to PostgreSQL.
Implementations§
Source§impl LogStore
impl LogStore
Sourcepub async fn store(&self, logs: Vec<LogEntry>) -> Result<()>
pub async fn store(&self, logs: Vec<LogEntry>) -> Result<()>
Store a batch of logs to the database.
Sourcepub async fn query(
&self,
level: Option<LogLevel>,
from: Option<DateTime<Utc>>,
to: Option<DateTime<Utc>>,
limit: usize,
) -> Result<Vec<LogEntry>>
pub async fn query( &self, level: Option<LogLevel>, from: Option<DateTime<Utc>>, to: Option<DateTime<Utc>>, limit: usize, ) -> Result<Vec<LogEntry>>
Query logs with filters.
Sourcepub async fn search(&self, query: &str, limit: usize) -> Result<Vec<LogEntry>>
pub async fn search(&self, query: &str, limit: usize) -> Result<Vec<LogEntry>>
Search logs by message content.
Sourcepub async fn pending_count(&self) -> usize
pub async fn pending_count(&self) -> usize
Get pending count.
Auto Trait Implementations§
impl Freeze for LogStore
impl !RefUnwindSafe for LogStore
impl Send for LogStore
impl Sync for LogStore
impl Unpin for LogStore
impl !UnwindSafe for LogStore
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