#[non_exhaustive]pub struct Refusal {
pub status: u16,
pub code: &'static str,
}Expand description
Why an inspector refused the input: the HTTP status it wants and a stable, machine-readable code for the reason.
FormError::status_hint returns the
status (400 when it is outside 400 to 599: a refusal is never a success);
FormError::code returns the code. The code
must never contain input.
§Examples
use form_net::Refusal;
let r = Refusal::new(415, "customs.avatar_not_image");
assert_eq!((r.status, r.code), (415, "customs.avatar_not_image"));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.status: u16The HTTP status the inspector wants.
code: &'static strThe inspector’s stable code for the reason.
Implementations§
Trait Implementations§
impl Copy for Refusal
impl Eq for Refusal
impl StructuralPartialEq for Refusal
Auto Trait Implementations§
impl Freeze for Refusal
impl RefUnwindSafe for Refusal
impl Send for Refusal
impl Sync for Refusal
impl Unpin for Refusal
impl UnsafeUnpin for Refusal
impl UnwindSafe for Refusal
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