pub(crate) struct ErrorResponseBody {
pub(crate) error: String,
pub(crate) message: String,
}Expand description
エラーレスポンスボディ
エラー発生時(4xx, 5xx)のレスポンスボディ形式を定義します。
openapi フィーチャー有効時のみ OpenAPI スキーマとして使用されます。
実際のエラーレスポンスは Response::error メソッドで生成されます。
§使用例
{
"error": "Unauthorized",
"message": "Invalid or missing required JWT claims"
}Fields§
§error: Stringエラーの種類を示す短い識別子(例: "Unauthorized", "INTERNAL_SERVER_ERROR")
message: Stringエラーの詳細メッセージ。デバッグや表示に使用する。
Trait Implementations§
Source§impl Debug for ErrorResponseBody
impl Debug for ErrorResponseBody
Auto Trait Implementations§
impl Freeze for ErrorResponseBody
impl RefUnwindSafe for ErrorResponseBody
impl Send for ErrorResponseBody
impl Sync for ErrorResponseBody
impl Unpin for ErrorResponseBody
impl UnsafeUnpin for ErrorResponseBody
impl UnwindSafe for ErrorResponseBody
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<B> IntoFunctionResponse<B, Body> for Bwhere
B: Serialize,
impl<B> IntoFunctionResponse<B, Body> for Bwhere
B: Serialize,
§fn into_response(self) -> FunctionResponse<B, Body>
fn into_response(self) -> FunctionResponse<B, Body>
Convert the type into a FunctionResponse.
Creates a shared type from an unshared type.