pub enum ExtractorError {
PathRejection(PathRejection),
QueryRejection(QueryRejection),
JsonRejection(JsonRejection),
FormRejection(FormRejection),
ExtensionRejection(ExtensionRejection),
Custom(String),
}Expand description
Extractor 错误类型
统一封装所有提取器可能产生的错误,便于错误处理和响应。
Variants§
PathRejection(PathRejection)
路径参数提取错误
QueryRejection(QueryRejection)
查询参数提取错误
JsonRejection(JsonRejection)
JSON 提取错误
FormRejection(FormRejection)
表单数据提取错误
ExtensionRejection(ExtensionRejection)
扩展数据提取错误
Custom(String)
自定义错误消息
Trait Implementations§
Source§impl Debug for ExtractorError
impl Debug for ExtractorError
Source§impl Display for ExtractorError
impl Display for ExtractorError
Source§impl Error for ExtractorError
impl Error for ExtractorError
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<ExtensionRejection> for ExtractorError
impl From<ExtensionRejection> for ExtractorError
Source§fn from(e: ExtensionRejection) -> Self
fn from(e: ExtensionRejection) -> Self
Converts to this type from the input type.
Source§impl From<FormRejection> for ExtractorError
impl From<FormRejection> for ExtractorError
Source§fn from(e: FormRejection) -> Self
fn from(e: FormRejection) -> Self
Converts to this type from the input type.
Source§impl From<JsonRejection> for ExtractorError
impl From<JsonRejection> for ExtractorError
Source§fn from(e: JsonRejection) -> Self
fn from(e: JsonRejection) -> Self
Converts to this type from the input type.
Source§impl From<PathRejection> for ExtractorError
impl From<PathRejection> for ExtractorError
Source§fn from(e: PathRejection) -> Self
fn from(e: PathRejection) -> Self
Converts to this type from the input type.
Source§impl From<QueryRejection> for ExtractorError
impl From<QueryRejection> for ExtractorError
Source§fn from(e: QueryRejection) -> Self
fn from(e: QueryRejection) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ExtractorError
impl !RefUnwindSafe for ExtractorError
impl Send for ExtractorError
impl Sync for ExtractorError
impl Unpin for ExtractorError
impl UnsafeUnpin for ExtractorError
impl !UnwindSafe for ExtractorError
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