pub struct StatusCodeMapper;Expand description
Map common validation errors to HTTP status codes
Implementations§
Source§impl StatusCodeMapper
impl StatusCodeMapper
Sourcepub fn for_validation_error(error_type: &str) -> u16
pub fn for_validation_error(error_type: &str) -> u16
Get status code for validation error type
Sourcepub fn status_name(code: u16) -> &'static str
pub fn status_name(code: u16) -> &'static str
Get status code name
Sourcepub fn is_success(code: u16) -> bool
pub fn is_success(code: u16) -> bool
Check if status code indicates success
Sourcepub fn is_client_error(code: u16) -> bool
pub fn is_client_error(code: u16) -> bool
Check if status code indicates client error
Sourcepub fn is_server_error(code: u16) -> bool
pub fn is_server_error(code: u16) -> bool
Check if status code indicates server error
Auto Trait Implementations§
impl Freeze for StatusCodeMapper
impl RefUnwindSafe for StatusCodeMapper
impl Send for StatusCodeMapper
impl Sync for StatusCodeMapper
impl Unpin for StatusCodeMapper
impl UnsafeUnpin for StatusCodeMapper
impl UnwindSafe for StatusCodeMapper
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