pub struct AuditRules { /* private fields */ }Expand description
审计规则:允许/拒绝列表,用于决定是否记录某条 SQL 审计日志。
规则评估顺序:
- 若 SQL 命中拒绝列表中的任一模式 → 不记录
- 若允许列表为空 → 记录所有未命中拒绝列表的 SQL
- 若允许列表非空 → 仅记录命中允许列表的 SQL
Implementations§
Source§impl AuditRules
impl AuditRules
pub fn new() -> Self
Sourcepub fn should_audit(&self, sql: &str) -> bool
pub fn should_audit(&self, sql: &str) -> bool
判断给定 SQL 是否应该被审计记录
Sourcepub fn allow_count(&self) -> usize
pub fn allow_count(&self) -> usize
返回允许模式数量
Sourcepub fn deny_count(&self) -> usize
pub fn deny_count(&self) -> usize
返回拒绝模式数量
Trait Implementations§
Source§impl Clone for AuditRules
impl Clone for AuditRules
Source§fn clone(&self) -> AuditRules
fn clone(&self) -> AuditRules
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 AuditRules
impl Debug for AuditRules
Source§impl Default for AuditRules
impl Default for AuditRules
Source§fn default() -> AuditRules
fn default() -> AuditRules
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AuditRules
impl RefUnwindSafe for AuditRules
impl Send for AuditRules
impl Sync for AuditRules
impl Unpin for AuditRules
impl UnsafeUnpin for AuditRules
impl UnwindSafe for AuditRules
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