pub enum MultipartError {
Malformed(&'static str),
TooLarge {
limit: usize,
},
Transport(BodyStreamError),
}Expand description
A failure produced while reading a multipart/form-data request body.
Variants§
Malformed(&'static str)
The bytes are not a well-formed multipart/form-data document.
The reason strings are the ones the buffered Multipart<T> extractor
already reports, and the projected failure carries the same status and
code, so a malformed body looks the same whichever reader saw it.
TooLarge
A handler asked to buffer a part that turned out to be larger than the limit it named.
Transport(BodyStreamError)
The transport could not deliver the rest of the body.
Surfacing this instead of treating it as the end of the body is what stops a truncated upload from being reported as a complete one.
Implementations§
Trait Implementations§
Source§impl ApiError for MultipartError
impl ApiError for MultipartError
fn response_descriptors() -> Vec<ResponseDescriptor>
Source§fn into_failure(self) -> Result<OperationFailure, ResponseBuildError>
fn into_failure(self) -> Result<OperationFailure, ResponseBuildError>
Converts the declared error into its transport-neutral failure. Read more
Source§impl Clone for MultipartError
impl Clone for MultipartError
Source§fn clone(&self) -> MultipartError
fn clone(&self) -> MultipartError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MultipartError
impl Debug for MultipartError
Source§impl Display for MultipartError
impl Display for MultipartError
impl Eq for MultipartError
Source§impl Error for MultipartError
impl Error for MultipartError
1.30.0 · 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 PartialEq for MultipartError
impl PartialEq for MultipartError
impl StructuralPartialEq for MultipartError
Auto Trait Implementations§
impl Freeze for MultipartError
impl RefUnwindSafe for MultipartError
impl Send for MultipartError
impl Sync for MultipartError
impl Unpin for MultipartError
impl UnsafeUnpin for MultipartError
impl UnwindSafe for MultipartError
Blanket Implementations§
Source§impl<T> BackgroundExt for T
impl<T> BackgroundExt for T
fn background(self, task: BackgroundTask) -> Background<Self>
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