pub struct ErrorStatistics { /* private fields */ }Expand description
错误统计信息
用于收集和报告错误统计数据
Implementations§
Source§impl ErrorStatistics
impl ErrorStatistics
Sourcepub fn record(&mut self, error: &XLinkError)
pub fn record(&mut self, error: &XLinkError)
记录一个错误
Sourcepub fn total_count(&self) -> u64
pub fn total_count(&self) -> u64
获取错误总数
Sourcepub fn get_by_category(&self) -> &HashMap<String, u64>
pub fn get_by_category(&self) -> &HashMap<String, u64>
获取按类别分组的错误统计
Sourcepub fn get_category_count(&self, category: ErrorCategory) -> u64
pub fn get_category_count(&self, category: ErrorCategory) -> u64
获取特定类别的错误计数
Sourcepub fn last_error(&self) -> Option<DateTime<Utc>>
pub fn last_error(&self) -> Option<DateTime<Utc>>
获取最后错误时间
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
检查是否有特定类型的错误
Trait Implementations§
Source§impl Debug for ErrorStatistics
impl Debug for ErrorStatistics
Source§impl Default for ErrorStatistics
impl Default for ErrorStatistics
Source§fn default() -> ErrorStatistics
fn default() -> ErrorStatistics
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ErrorStatistics
impl<'de> Deserialize<'de> for ErrorStatistics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ErrorStatistics
impl RefUnwindSafe for ErrorStatistics
impl Send for ErrorStatistics
impl Sync for ErrorStatistics
impl Unpin for ErrorStatistics
impl UnwindSafe for ErrorStatistics
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more