pub struct TraceFilter {
pub min_level: Option<TraceLevel>,
pub category: Option<String>,
pub label: Option<String>,
pub since: Option<Instant>,
}Expand description
TRACE 过滤器
Fields§
§min_level: Option<TraceLevel>最低级别(如 Some(TraceLevel::Warn) 表示只显示 Warn 及以上)
category: Option<String>类别匹配
label: Option<String>标签匹配
since: Option<Instant>起始时间
Implementations§
Source§impl TraceFilter
impl TraceFilter
Sourcepub fn with_min_level(self, level: TraceLevel) -> Self
pub fn with_min_level(self, level: TraceLevel) -> Self
设置最低级别
Sourcepub fn with_category(self, category: String) -> Self
pub fn with_category(self, category: String) -> Self
设置类别
Sourcepub fn with_label(self, label: String) -> Self
pub fn with_label(self, label: String) -> Self
设置标签
Sourcepub fn with_since(self, since: Instant) -> Self
pub fn with_since(self, since: Instant) -> Self
设置起始时间
Sourcepub fn matches(&self, entry: &TraceEntry) -> bool
pub fn matches(&self, entry: &TraceEntry) -> bool
检查条目是否匹配过滤器
Trait Implementations§
Source§impl Clone for TraceFilter
impl Clone for TraceFilter
Source§fn clone(&self) -> TraceFilter
fn clone(&self) -> TraceFilter
Returns a duplicate of the value. Read more
1.0.0 · 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 TraceFilter
impl Debug for TraceFilter
Source§impl Default for TraceFilter
impl Default for TraceFilter
Source§fn default() -> TraceFilter
fn default() -> TraceFilter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TraceFilter
impl RefUnwindSafe for TraceFilter
impl Send for TraceFilter
impl Sync for TraceFilter
impl Unpin for TraceFilter
impl UnwindSafe for TraceFilter
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