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
审计日志查询过滤器
Fields§
§user: Option<String>按用户名过滤(精确匹配,None 表示不过滤)
from_ts: Option<i64>时间范围起始(毫秒时间戳,None 表示不限制下限)
to_ts: Option<i64>时间范围结束(毫秒时间戳,None 表示不限制上限)
sql_contains: Option<String>SQL 关键词过滤(大小写不敏感子串匹配,None 表示不过滤)
limit: usize限制返回条数(0 表示不限制)
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
按时间范围过滤(毫秒时间戳)
Sourcepub fn by_sql_contains(self, keyword: impl Into<String>) -> Self
pub fn by_sql_contains(self, keyword: impl Into<String>) -> Self
按 SQL 关键词过滤(大小写不敏感)
Sourcepub fn with_limit(self, limit: usize) -> Self
pub fn with_limit(self, limit: usize) -> Self
限制返回条数
Sourcepub fn filter(&self, logs: &[SqlAuditContext]) -> Vec<SqlAuditContext>
pub fn filter(&self, logs: &[SqlAuditContext]) -> Vec<SqlAuditContext>
对日志列表执行查询过滤
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