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 schema<I>(self, schema: Option<I>) -> ContentBuilder
pub fn schema<I>(self, schema: Option<I>) -> ContentBuilder
Add schema.
Sourcepub fn example(self, example: Option<Value>) -> ContentBuilder
pub fn example(self, example: Option<Value>) -> ContentBuilder
Add example of schema.
Sourcepub fn examples_from_iter<E, N, V>(self, examples: E) -> ContentBuilder
pub fn examples_from_iter<E, N, V>(self, examples: E) -> ContentBuilder
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, E>(self, property_name: S, encoding: E) -> ContentBuilder
pub fn encoding<S, E>(self, property_name: S, encoding: E) -> ContentBuilder
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.
Sourcepub fn extensions(self, extensions: Option<Extensions>) -> ContentBuilder
pub fn extensions(self, extensions: Option<Extensions>) -> ContentBuilder
Add openapi extensions (x-something) of the API.
Trait Implementations§
Source§impl Default for ContentBuilder
impl Default for ContentBuilder
Source§fn default() -> ContentBuilder
fn default() -> ContentBuilder
Returns the “default value” for a type. Read more
Source§impl From<Content> for ContentBuilder
impl From<Content> for ContentBuilder
Source§fn from(value: Content) -> ContentBuilder
fn from(value: Content) -> ContentBuilder
Converts to this type from the input type.
Source§impl From<ContentBuilder> for Content
impl From<ContentBuilder> for Content
Source§fn from(value: ContentBuilder) -> Content
fn from(value: ContentBuilder) -> Content
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