pub struct EventFilter { /* private fields */ }Expand description
按事件类型(EventPayload::kind())预计算的开关表。
从 TelemetryConfig::event_toggles/default_event_enabled 构建一次,
之后每次 record() 只是一次 HashMap 查表,不重新解析配置。
Implementations§
Source§impl EventFilter
impl EventFilter
Sourcepub fn from_config(config: &TelemetryConfig) -> Self
pub fn from_config(config: &TelemetryConfig) -> Self
从配置构建。
Sourcepub fn all_enabled() -> Self
pub fn all_enabled() -> Self
全部放行——未按配置初始化的 handle(如测试、直接构造)的默认行为。
Sourcepub fn is_enabled(&self, kind: &str) -> bool
pub fn is_enabled(&self, kind: &str) -> bool
该事件类型是否应该被记录。
Trait Implementations§
Source§impl Clone for EventFilter
impl Clone for EventFilter
Source§impl Debug for EventFilter
impl Debug for EventFilter
Auto Trait Implementations§
impl Forget for EventFilter
impl Freeze for EventFilter
impl Move for EventFilter
impl RefUnwindSafe for EventFilter
impl Send for EventFilter
impl Sync for EventFilter
impl Unpin for EventFilter
impl UnsafeUnpin for EventFilter
impl UnwindSafe for EventFilter
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