pub struct GenericTypedResult {
pub message: String,
pub data: Option<Value>,
pub code: u16,
pub response_type: ResponseType,
}Expand description
Generic JSON-compatible result: serializes its data value directly, or "null" when absent.
Useful for endpoints whose payload is already a serde_json::Value.
Fields§
§message: StringHuman-readable message (used if serialization fails upstream).
data: Option<Value>Payload serialized directly as the body.
code: u16HTTP status code for the response.
response_type: ResponseTypeContent type used when rendering the response.
Trait Implementations§
Source§impl TypedServiceResult for GenericTypedResult
impl TypedServiceResult for GenericTypedResult
Source§fn response_type(&self) -> ResponseType
fn response_type(&self) -> ResponseType
Content type used for the
Content-Type header.Auto Trait Implementations§
impl Freeze for GenericTypedResult
impl RefUnwindSafe for GenericTypedResult
impl Send for GenericTypedResult
impl Sync for GenericTypedResult
impl Unpin for GenericTypedResult
impl UnsafeUnpin for GenericTypedResult
impl UnwindSafe for GenericTypedResult
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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