Struct utoipa::openapi::path::OperationBuilder

source ·
pub struct OperationBuilder { /* private fields */ }
Expand description

Builder for Operation with chainable configuration methods to create a new Operation.

Implementations§

source§

impl OperationBuilder

source

pub fn new() -> OperationBuilder

Constructs a new OperationBuilder.

source

pub fn build(self) -> Operation

Constructs a new Operation taking all fields values from this object.

source§

impl OperationBuilder

source

pub fn tags<I: IntoIterator<Item = String>>(self, tags: Option<I>) -> Self

Add or change tags of the Operation.

source

pub fn tag<S: Into<String>>(self, tag: S) -> Self

Append tag to Operation tags.

source

pub fn summary<S: Into<String>>(self, summary: Option<S>) -> Self

Add or change short summary of the Operation.

source

pub fn description<S: Into<String>>(self, description: Option<S>) -> Self

Add or change description of the Operation.

source

pub fn operation_id<S: Into<String>>(self, operation_id: Option<S>) -> Self

Add or change operation id of the Operation.

source

pub fn parameters<I: IntoIterator<Item = P>, P: Into<Parameter>>( self, parameters: Option<I>, ) -> Self

Add or change parameters of the Operation.

source

pub fn parameter<P: Into<Parameter>>(self, parameter: P) -> Self

Append parameter to Operation parameters.

source

pub fn request_body(self, request_body: Option<RequestBody>) -> Self

Add or change request body of the Operation.

source

pub fn responses<R: Into<Responses>>(self, responses: R) -> Self

Add or change responses of the Operation.

source

pub fn response<S: Into<String>, R: Into<RefOr<Response>>>( self, code: S, response: R, ) -> Self

Append status code and a Response to the Operation responses map.

  • code must be valid HTTP status code.
  • response is instances of Response.
source

pub fn deprecated(self, deprecated: Option<Deprecated>) -> Self

Add or change deprecated status of the Operation.

source

pub fn securities<I: IntoIterator<Item = SecurityRequirement>>( self, securities: Option<I>, ) -> Self

Add or change list of SecurityRequirements that are available for Operation.

source

pub fn security(self, security: SecurityRequirement) -> Self

Append SecurityRequirement to Operation security requirements.

source

pub fn servers<I: IntoIterator<Item = Server>>(self, servers: Option<I>) -> Self

Add or change list of Servers of the Operation.

source

pub fn server(self, server: Server) -> Self

Append a new Server to the Operation servers.

Trait Implementations§

source§

impl Default for OperationBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<Operation> for OperationBuilder

source§

fn from(value: Operation) -> Self

Converts to this type from the input type.
source§

impl From<OperationBuilder> for Operation

source§

fn from(value: OperationBuilder) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.