pub struct ErrorContext {
pub error_message: String,
pub user_friendly_message: String,
pub category: ErrorHandlingCategory,
pub is_recoverable: bool,
pub is_retryable: bool,
pub suggested_actions: Vec<String>,
pub help_url: Option<String>,
pub retry_strategy: Option<RetryStrategy>,
}Expand description
错误上下文信息
Fields§
§error_message: String原始错误消息
user_friendly_message: String用户友好的错误消息
category: ErrorHandlingCategory错误类别
is_recoverable: bool是否可恢复
is_retryable: bool是否可重试
suggested_actions: Vec<String>建议的操作
help_url: Option<String>帮助文档链接
retry_strategy: Option<RetryStrategy>重试策略
Implementations§
Source§impl ErrorContext
impl ErrorContext
Sourcepub fn print_details(&self)
pub fn print_details(&self)
打印详细的错误信息
Trait Implementations§
Source§impl Clone for ErrorContext
impl Clone for ErrorContext
Source§fn clone(&self) -> ErrorContext
fn clone(&self) -> ErrorContext
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 moreAuto Trait Implementations§
impl Freeze for ErrorContext
impl RefUnwindSafe for ErrorContext
impl Send for ErrorContext
impl Sync for ErrorContext
impl Unpin for ErrorContext
impl UnwindSafe for ErrorContext
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