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,
Source§impl StackError for MockError
impl StackError for MockError
fn debug_fmt(&self, _: usize, _: &mut Vec<String>)
fn next(&self) -> Option<&dyn StackError>
fn last(&self) -> &dyn StackErrorwhere
Self: Sized,
Source§fn transparent(&self) -> bool
fn transparent(&self) -> bool
Indicates whether this error is “transparent”, that it delegates its “display” and “source”
to the underlying error. Could be useful when you are just wrapping some external error,
AND can not or would not provide meaningful contextual info. For example, the
DataFusionError
.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