#[non_exhaustive]
pub enum Component {
Property(Property),
Ref(Ref),
Object(Object),
Array(Array),
OneOf(OneOf),
}
Expand description
Is super type for OpenAPI Schema Object components. Component
is reusable resource what can be referenced from path operations and other
components using Ref
component.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Property(Property)
Defines property component typically used together with
Component::Object
or Component::Array
. It is used to map
field types to OpenAPI documentation.
Ref(Ref)
Creates a reference component $ref=#/components/schemas/ComponentName
. Which
can be used to reference a other reusable component in Components
.
Object(Object)
Defines object component. This is formed from structs holding Property
components
created from it’s fields.
Array(Array)
Defines array component from another component. Typically used with
Component::Property
or Component::Object
component. Slice and Vec
types are translated to Component::Array
types.
OneOf(OneOf)
Creates a OneOf type Discriminator Object component. This component
is used to map multiple components together where API endpoint could return any of them.
Component::OneOf
is created form complex enum where enum holds other than unit types.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Component
impl<'de> Deserialize<'de> for Component
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<ArrayBuilder> for Component
impl From<ArrayBuilder> for Component
sourcefn from(builder: ArrayBuilder) -> Self
fn from(builder: ArrayBuilder) -> Self
Converts to this type from the input type.
sourceimpl From<ObjectBuilder> for Component
impl From<ObjectBuilder> for Component
sourcefn from(builder: ObjectBuilder) -> Self
fn from(builder: ObjectBuilder) -> Self
Converts to this type from the input type.
sourceimpl From<OneOfBuilder> for Component
impl From<OneOfBuilder> for Component
sourcefn from(builder: OneOfBuilder) -> Self
fn from(builder: OneOfBuilder) -> Self
Converts to this type from the input type.
sourceimpl From<PropertyBuilder> for Component
impl From<PropertyBuilder> for Component
sourcefn from(builder: PropertyBuilder) -> Self
fn from(builder: PropertyBuilder) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for Component
impl Send for Component
impl Sync for Component
impl Unpin for Component
impl UnwindSafe for Component
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more