pub struct ErrorContextBuilder { /* private fields */ }Expand description
错误上下文构建器
提供流式API来构建复杂的错误上下文
Implementations§
Source§impl ErrorContextBuilder
impl ErrorContextBuilder
Sourcepub fn user_message(self, message: impl Into<String>) -> Self
pub fn user_message(self, message: impl Into<String>) -> Self
设置用户消息
Sourcepub fn extend_context<I, K, V>(self, iter: I) -> Self
pub fn extend_context<I, K, V>(self, iter: I) -> Self
批量添加上下文信息
Sourcepub fn request_id(self, request_id: impl Into<String>) -> Self
pub fn request_id(self, request_id: impl Into<String>) -> Self
设置请求ID
Sourcepub fn build(self) -> ErrorContext
pub fn build(self) -> ErrorContext
构建错误上下文
Trait Implementations§
Source§impl Clone for ErrorContextBuilder
impl Clone for ErrorContextBuilder
Source§fn clone(&self) -> ErrorContextBuilder
fn clone(&self) -> ErrorContextBuilder
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 ErrorContextBuilder
impl Debug for ErrorContextBuilder
Auto Trait Implementations§
impl Freeze for ErrorContextBuilder
impl RefUnwindSafe for ErrorContextBuilder
impl Send for ErrorContextBuilder
impl Sync for ErrorContextBuilder
impl Unpin for ErrorContextBuilder
impl UnsafeUnpin for ErrorContextBuilder
impl UnwindSafe for ErrorContextBuilder
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