pub struct Error { /* private fields */ }Expand description
Implementations§
Source§impl Error
impl Error
pub fn kind(&self) -> &ErrorKind
pub fn into_kind(self) -> ErrorKind
pub fn new(kind: ErrorKind) -> Error
Sourcepub fn http(status: u16, message: impl Into<String>) -> Error
pub fn http(status: u16, message: impl Into<String>) -> Error
HTTP error with a message that is safe to show to users.
Sourcepub fn validation<I, K, V>(fields: I) -> Error
pub fn validation<I, K, V>(fields: I) -> Error
Validation errors keyed by field name.
pub fn status(&self) -> StatusCode
pub fn is_not_found(&self) -> bool
pub fn is_redirect(&self) -> bool
Sourcepub fn public_message(&self) -> String
pub fn public_message(&self) -> String
Message safe for end users in production.
Sourcepub fn detailed_message(&self) -> String
pub fn detailed_message(&self) -> String
Full message including internal details (development only).
Trait Implementations§
Source§impl IntoResponse for Error
impl IntoResponse for Error
fn into_response(self) -> Response
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Forget for Error
impl Freeze for Error
impl Move for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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