pub enum ParseError {
InvalidMethod {
method: String,
},
InvalidHeaderName {
name: String,
},
InvalidHeaderValue {
value: String,
},
HeaderToStrError,
InvalidStatusCode {
code: u16,
},
JsonRejection {
message: String,
},
}
Expand description
Framework-native parsing errors (replaces Axum error exposures)
Variants§
InvalidMethod
InvalidHeaderName
InvalidHeaderValue
HeaderToStrError
InvalidStatusCode
JsonRejection
Implementations§
Source§impl ParseError
impl ParseError
Sourcepub fn invalid_method<T: Into<String>>(method: T) -> Self
pub fn invalid_method<T: Into<String>>(method: T) -> Self
Create an invalid method error
Sourcepub fn invalid_header_name<T: Into<String>>(name: T) -> Self
pub fn invalid_header_name<T: Into<String>>(name: T) -> Self
Create an invalid header name error
Sourcepub fn invalid_header_value<T: Into<String>>(value: T) -> Self
pub fn invalid_header_value<T: Into<String>>(value: T) -> Self
Create an invalid header value error
Sourcepub fn header_to_str_error() -> Self
pub fn header_to_str_error() -> Self
Create a header to string error
Sourcepub fn invalid_status_code(code: u16) -> Self
pub fn invalid_status_code(code: u16) -> Self
Create an invalid status code error
Sourcepub fn json_rejection<T: Into<String>>(message: T) -> Self
pub fn json_rejection<T: Into<String>>(message: T) -> Self
Create a JSON rejection error
Trait Implementations§
Source§impl Debug for ParseError
impl Debug for ParseError
Source§impl Display for ParseError
impl Display for ParseError
Source§impl Error for ParseError
impl Error for ParseError
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 From<InvalidHeaderName> for ParseError
impl From<InvalidHeaderName> for ParseError
Source§fn from(err: InvalidHeaderName) -> Self
fn from(err: InvalidHeaderName) -> Self
Converts to this type from the input type.
Source§impl From<InvalidHeaderValue> for ParseError
impl From<InvalidHeaderValue> for ParseError
Source§fn from(err: InvalidHeaderValue) -> Self
fn from(err: InvalidHeaderValue) -> Self
Converts to this type from the input type.
Source§impl From<InvalidMethod> for ParseError
impl From<InvalidMethod> for ParseError
Source§fn from(err: InvalidMethod) -> Self
fn from(err: InvalidMethod) -> Self
Converts to this type from the input type.
Source§impl From<JsonRejection> for ParseError
impl From<JsonRejection> for ParseError
Source§fn from(err: JsonRejection) -> Self
fn from(err: JsonRejection) -> Self
Converts to this type from the input type.
Source§impl From<ToStrError> for ParseError
impl From<ToStrError> for ParseError
Source§fn from(_: ToStrError) -> Self
fn from(_: ToStrError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ParseError
impl RefUnwindSafe for ParseError
impl Send for ParseError
impl Sync for ParseError
impl Unpin for ParseError
impl UnwindSafe for ParseError
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