pub struct ErrorContext {
pub request: RequestContext,
pub response: Option<Response>,
pub error: Error,
}Expand description
Context when an error occurs.
Fields§
§request: RequestContextOriginal request context.
response: Option<Response>Response when the error is HTTP-related.
error: ErrorError that occurred.
Implementations§
Source§impl ErrorContext
impl ErrorContext
Sourcepub fn response_body_preview(&self, max_bytes: usize) -> Option<String>
pub fn response_body_preview(&self, max_bytes: usize) -> Option<String>
UTF-8 preview of the buffered response body when Self::response is set.
Non-UTF-8 bodies return None. Truncates to max_bytes (default use: 512).
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 (const: unstable) · 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 UnsafeUnpin 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