Struct utoipa::openapi::content::ContentBuilder
source · pub struct ContentBuilder { /* private fields */ }
Implementations§
source§impl ContentBuilder
impl ContentBuilder
sourcepub fn new() -> ContentBuilder
pub fn new() -> ContentBuilder
Constructs a new ContentBuilder
.
source§impl ContentBuilder
impl ContentBuilder
sourcepub fn examples_from_iter<E: IntoIterator<Item = (N, V)>, N: Into<String>, V: Into<RefOr<Example>>>(
self,
examples: E
) -> Self
pub fn examples_from_iter<E: IntoIterator<Item = (N, V)>, N: Into<String>, V: Into<RefOr<Example>>>( self, examples: E ) -> Self
Add iterator of (N, V)
where N
is name of example and V
is Example
to
Content
of a request body or response body.
Content::examples
and Content::example
are mutually exclusive. If both are defined
examples
will override value in example
.
sourcepub fn encoding<S: Into<String>, E: Into<Encoding>>(
self,
property_name: S,
encoding: E
) -> Self
pub fn encoding<S: Into<String>, E: Into<Encoding>>( self, property_name: S, encoding: E ) -> Self
Add an encoding.
The property_name
MUST exist in the Content::schema
as a property,
with schema
being a Schema::Object
and this object containing the same property
key in Object::properties
.
The encoding object SHALL only apply to request_body
objects when the media type is
multipart or application/x-www-form-urlencoded
.
Trait Implementations§
source§impl Default for ContentBuilder
impl Default for ContentBuilder
source§impl From<Content> for ContentBuilder
impl From<Content> for ContentBuilder
source§impl From<ContentBuilder> for Content
impl From<ContentBuilder> for Content
source§fn from(value: ContentBuilder) -> Self
fn from(value: ContentBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for ContentBuilder
impl Send for ContentBuilder
impl Sync for ContentBuilder
impl Unpin for ContentBuilder
impl UnwindSafe for ContentBuilder
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