utoipa::openapi::link

Struct LinkBuilder

Source
pub struct LinkBuilder { /* private fields */ }
Expand description

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

Implementations§

Source§

impl LinkBuilder

Source

pub fn new() -> LinkBuilder

Constructs a new LinkBuilder.

Source

pub fn build(self) -> Link

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

Source§

impl LinkBuilder

Source

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

Set a relative or absolute URI reference to an OAS operation. This field is mutually exclusive of the operation_id field, and must point to an Operation Object.

Source

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

Set the name of an existing, resolvable OAS operation, as defined with a unique operation_id. This field is mutually exclusive of the operation_ref field.

Source

pub fn parameter<N: Into<String>, V: Into<Value>>( self, name: N, value: V, ) -> Self

Add parameter to be passed to Operation upon execution.

Source

pub fn request_body<B: Into<Value>>(self, request_body: Option<B>) -> Self

Set a literal value or an expression to be used as request body when operation is called.

Source

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

Set description of the link. Value supports Markdown syntax.

Source

pub fn server<S: Into<Server>>(self, server: Option<S>) -> Self

Set a Server object to be used by the target operation.

Source

pub fn extensions(self, extensions: Option<Extensions>) -> Self

Add openapi extensions (x-something) of the API.

Trait Implementations§

Source§

impl Default for LinkBuilder

Source§

fn default() -> Self

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

impl From<Link> for LinkBuilder

Source§

fn from(value: Link) -> Self

Converts to this type from the input type.
Source§

fn from(value: LinkBuilder) -> 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>,

Source§

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>,

Source§

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.