pub struct ContentError { /* private fields */ }Expand description
Why content could not be parsed at all, with the offset in the body where the parser found it.
A fatal error stops parsing, and the parser reports the same error for every later call. It never includes submitted content, field values, filenames, media types, or names the declaration does not accept: only its kind and offset. Each kind maps to one HTTP status, from Self::status.
Implementations§
Source§impl ContentError
impl ContentError
Sourcepub fn kind(&self) -> ContentErrorKind
pub fn kind(&self) -> ContentErrorKind
What went wrong.
Sourcepub fn offset(&self) -> u64
pub fn offset(&self) -> u64
The offset in the body, in bytes, where the parser found the problem: 0 for a problem with the media type; the start of a part’s header section for a problem with the section, its size, its fields, or the part’s name, which are decided when the section is complete; the start of the spaces and tabs after a boundary when they alone exceed the header section limit; the start of a URL-encoded name for a problem with the name, or the first byte beyond the longest it could be; and otherwise the first byte beyond a limit, or the first byte that is malformed.
Trait Implementations§
Source§impl Clone for ContentError
impl Clone for ContentError
impl Copy for ContentError
Source§impl Debug for ContentError
impl Debug for ContentError
Source§impl Display for ContentError
impl Display for ContentError
impl Eq for ContentError
Source§impl Error for ContentError
impl Error for ContentError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()