pub struct AuditQuery {
pub user: Option<String>,
pub from_ts: Option<i64>,
pub to_ts: Option<i64>,
pub sql_contains: Option<String>,
pub limit: usize,
}Expand description
Audit log query filter
Fields§
§user: Option<String>Filter by username (exact match; None means no filter)
from_ts: Option<i64>Time range start (millisecond timestamp; None means no lower bound)
to_ts: Option<i64>Time range end (millisecond timestamp; None means no upper bound)
sql_contains: Option<String>SQL keyword filter (case-insensitive substring match; None means no filter)
limit: usizeLimit on the number of returned entries (0 means unlimited)
Implementations§
Source§impl AuditQuery
impl AuditQuery
pub fn new() -> Self
Sourcepub fn by_time_range(self, from: i64, to: i64) -> Self
pub fn by_time_range(self, from: i64, to: i64) -> Self
Filter by time range (millisecond timestamps)
Sourcepub fn by_sql_contains(self, keyword: impl Into<String>) -> Self
pub fn by_sql_contains(self, keyword: impl Into<String>) -> Self
Filter by SQL keyword (case-insensitive)
Sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
Limit the number of returned entries
Sourcepub fn filter(&self, logs: &[SqlAuditContext]) -> Vec<SqlAuditContext>
pub fn filter(&self, logs: &[SqlAuditContext]) -> Vec<SqlAuditContext>
Apply the query filter to a list of logs
Trait Implementations§
Source§impl Clone for AuditQuery
impl Clone for AuditQuery
Source§fn clone(&self) -> AuditQuery
fn clone(&self) -> AuditQuery
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuditQuery
impl Debug for AuditQuery
Source§impl Default for AuditQuery
impl Default for AuditQuery
Source§fn default() -> AuditQuery
fn default() -> AuditQuery
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AuditQuery
impl RefUnwindSafe for AuditQuery
impl Send for AuditQuery
impl Sync for AuditQuery
impl Unpin for AuditQuery
impl UnsafeUnpin for AuditQuery
impl UnwindSafe for AuditQuery
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