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 Freeze for ContentBuilder
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