pub struct NegotiatedBody {
pub name: RustIdent,
pub variants: Vec<BodyVariant>,
}Expand description
A body offering several content-type representations, lowered into a generated enum with one variant per representation.
For a request the enum is a hand-written FromRequest that dispatches on
Content-Type. for a response it is a plain enum the handler selects a
representation from, which the generated IntoResponse renders with the
matching Content-Type.
Fields§
§name: RustIdentEnum name — <Op>RequestBody for a request, <Response><Variant>Body
for a response — doubling as the argument/field type on the generated
interface.
variants: Vec<BodyVariant>One variant per supported content type, in priority order (JSON > form > text).
Trait Implementations§
Source§impl Clone for NegotiatedBody
impl Clone for NegotiatedBody
Source§fn clone(&self) -> NegotiatedBody
fn clone(&self) -> NegotiatedBody
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NegotiatedBody
impl Debug for NegotiatedBody
Source§impl PartialEq for NegotiatedBody
impl PartialEq for NegotiatedBody
impl StructuralPartialEq for NegotiatedBody
Auto Trait Implementations§
impl Freeze for NegotiatedBody
impl RefUnwindSafe for NegotiatedBody
impl Send for NegotiatedBody
impl Sync for NegotiatedBody
impl Unpin for NegotiatedBody
impl UnsafeUnpin for NegotiatedBody
impl UnwindSafe for NegotiatedBody
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