pub enum PostFieldError {
IoError(Error),
MissingField,
WrongFieldType,
UnexpectedMultipleValues,
WrongDataTypeInt(ParseIntError),
WrongDataTypeFloat(ParseFloatError),
}
Expand description
Error returned by the methods of the DecodePostField
trait.
Variants§
IoError(Error)
Could not read the body. Usually happens with files.
MissingField
A field is missing from the received data.
WrongFieldType
Expected a file but got a field, or vice versa.
UnexpectedMultipleValues
Got multiple values for the same field while only one was expected.
WrongDataTypeInt(ParseIntError)
Failed to parse an integer field.
WrongDataTypeFloat(ParseFloatError)
Failed to parse a floating-point field.
Trait Implementations§
Source§impl Debug for PostFieldError
impl Debug for PostFieldError
Source§impl Display for PostFieldError
impl Display for PostFieldError
Source§impl Error for PostFieldError
impl Error for PostFieldError
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 From<Error> for PostFieldError
impl From<Error> for PostFieldError
Source§fn from(err: IoError) -> PostFieldError
fn from(err: IoError) -> PostFieldError
Converts to this type from the input type.
Source§impl From<ParseFloatError> for PostFieldError
impl From<ParseFloatError> for PostFieldError
Source§fn from(err: ParseFloatError) -> PostFieldError
fn from(err: ParseFloatError) -> PostFieldError
Converts to this type from the input type.
Source§impl From<ParseIntError> for PostFieldError
impl From<ParseIntError> for PostFieldError
Source§fn from(err: ParseIntError) -> PostFieldError
fn from(err: ParseIntError) -> PostFieldError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PostFieldError
impl !RefUnwindSafe for PostFieldError
impl Send for PostFieldError
impl Sync for PostFieldError
impl Unpin for PostFieldError
impl !UnwindSafe for PostFieldError
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