pub struct MockError {
pub code: StatusCode,
source: Option<Box<MockError>>,
}
Expand description
A mock error mainly for test.
Fields§
§code: StatusCode
§source: Option<Box<MockError>>
Implementations§
Trait Implementations§
source§impl Error for MockError
impl Error for MockError
source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
source§impl ErrorExt for MockError
impl ErrorExt for MockError
source§fn status_code(&self) -> StatusCode
fn status_code(&self) -> StatusCode
Map this error to StatusCode.
source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Returns the error as Any so that it can be
downcast to a specific implementation.
fn output_msg(&self) -> Stringwhere
Self: Sized,
Auto Trait Implementations§
impl Freeze for MockError
impl RefUnwindSafe for MockError
impl Send for MockError
impl Sync for MockError
impl Unpin for MockError
impl UnwindSafe for MockError
Blanket Implementations§
§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request