pub struct RequestBody {
pub description: Option<String>,
pub content: Map<MediaType>,
pub required: Option<bool>,
pub extensions: Extensions,
}Expand description
A request body.
Fields§
§description: Option<String>A description of the body. CommonMark syntax may be used.
content: Map<MediaType>The body’s representations, keyed by media type or media type range.
More than one entry describes a body the server accepts in several encodings.
required: Option<bool>Whether the body is mandatory. Defaults to false.
extensions: ExtensionsSpecification extensions.
Implementations§
Source§impl RequestBody
impl RequestBody
Sourcepub fn new(media_type: impl Into<String>, content: MediaType) -> Self
pub fn new(media_type: impl Into<String>, content: MediaType) -> Self
Creates a required body with a single media type.
Sourcepub fn with_media_type(
self,
media_type: impl Into<String>,
content: MediaType,
) -> Self
pub fn with_media_type( self, media_type: impl Into<String>, content: MediaType, ) -> Self
Adds another representation of the same body.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Sets the description.
Trait Implementations§
Source§impl Clone for RequestBody
impl Clone for RequestBody
Source§impl Debug for RequestBody
impl Debug for RequestBody
Source§impl Default for RequestBody
impl Default for RequestBody
Source§impl<'de> Deserialize<'de> for RequestBody
impl<'de> Deserialize<'de> for RequestBody
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for RequestBody
impl PartialEq for RequestBody
Source§impl Serialize for RequestBody
impl Serialize for RequestBody
impl StructuralPartialEq for RequestBody
Auto Trait Implementations§
impl Freeze for RequestBody
impl RefUnwindSafe for RequestBody
impl Send for RequestBody
impl Sync for RequestBody
impl Unpin for RequestBody
impl UnsafeUnpin for RequestBody
impl UnwindSafe for RequestBody
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