pub struct PlainError {
msg: String,
status_code: StatusCode,
}
Expand description
Error type with plain error message
Fields§
§msg: String
§status_code: StatusCode
Implementations§
source§impl PlainError
impl PlainError
pub fn new(msg: String, status_code: StatusCode) -> Self
Trait Implementations§
source§impl Debug for PlainError
impl Debug for PlainError
source§impl Display for PlainError
impl Display for PlainError
source§impl Error for PlainError
impl Error for PlainError
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 PlainError
impl ErrorExt for PlainError
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 PlainError
impl StackError for PlainError
Auto Trait Implementations§
impl Freeze for PlainError
impl RefUnwindSafe for PlainError
impl Send for PlainError
impl Sync for PlainError
impl Unpin for PlainError
impl UnwindSafe for PlainError
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