Struct utoipa::openapi::schema::ArrayBuilder

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

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

Implementations§

source§

impl ArrayBuilder

source

pub fn new() -> ArrayBuilder

Constructs a new ArrayBuilder.

source

pub fn build(self) -> Array

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

source§

impl ArrayBuilder

source

pub fn items<I: Into<RefOr<Schema>>>(self, component: I) -> Self

Set Schema type for the Array.

source

pub fn title<I: Into<String>>(self, title: Option<I>) -> Self

Add or change the title of the Array.

source

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

Add or change description of the property. Markdown syntax is supported.

source

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

Add or change deprecated status for Array.

source

pub fn example(self, example: Option<Value>) -> Self

Add or change example shown in UI of the value for richer documentation.

source

pub fn default(self, default: Option<Value>) -> Self

Add or change default value for the object which is provided when user has not provided the input in Swagger UI.

source

pub fn max_items(self, max_items: Option<usize>) -> Self

Set maximum allowed length for Array.

source

pub fn min_items(self, min_items: Option<usize>) -> Self

Set minimum allowed length for Array.

source

pub fn unique_items(self, unique_items: bool) -> Self

Set or change whether Array should enforce all items to be unique.

source

pub fn xml(self, xml: Option<Xml>) -> Self

Set Xml formatting for Array.

source

pub fn nullable(self, nullable: bool) -> Self

Add or change nullable flag for Object.

source

pub fn to_array_builder(self) -> ArrayBuilder

Construct a new ArrayBuilder with this component set to ArrayBuilder::items.

Trait Implementations§

source§

impl Default for ArrayBuilder

source§

fn default() -> Self

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

impl From<Array> for ArrayBuilder

source§

fn from(value: Array) -> Self

Converts to this type from the input type.
source§

impl From<ArrayBuilder> for Array

source§

fn from(value: ArrayBuilder) -> Self

Converts to this type from the input type.
source§

impl From<ArrayBuilder> for RefOr<Schema>

source§

fn from(array: ArrayBuilder) -> Self

Converts to this type from the input type.
source§

impl From<ArrayBuilder> for Schema

source§

fn from(builder: ArrayBuilder) -> 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.