pub enum RefOr<T> {
Ref(Ref),
T(T),
}
Expand description
A Ref
or some other type T
.
Typically used in combination with Components
and is an union type between Ref
and any
other given type such as Schema
or Response
.
Variants§
Ref(Ref)
Represents Ref
reference to another OpenAPI object instance. e.g.
$ref: #/components/schemas/Hello
T(T)
Represents any value that can be added to the Components
e.g. Schema
or Response
.
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for RefOr<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for RefOr<T>where
T: Deserialize<'de>,
Source§fn 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
Source§impl From<AllOfBuilder> for RefOr<Schema>
impl From<AllOfBuilder> for RefOr<Schema>
Source§fn from(one_of: AllOfBuilder) -> Self
fn from(one_of: AllOfBuilder) -> Self
Converts to this type from the input type.
Source§impl From<AnyOfBuilder> for RefOr<Schema>
impl From<AnyOfBuilder> for RefOr<Schema>
Source§fn from(any_of: AnyOfBuilder) -> Self
fn from(any_of: AnyOfBuilder) -> Self
Converts to this type from the input type.
Source§impl From<ArrayBuilder> for RefOr<Schema>
impl From<ArrayBuilder> for RefOr<Schema>
Source§fn from(array: ArrayBuilder) -> Self
fn from(array: ArrayBuilder) -> Self
Converts to this type from the input type.
Source§impl From<ExampleBuilder> for RefOr<Example>
impl From<ExampleBuilder> for RefOr<Example>
Source§fn from(example_builder: ExampleBuilder) -> Self
fn from(example_builder: ExampleBuilder) -> Self
Converts to this type from the input type.
Source§impl From<ObjectBuilder> for RefOr<Schema>
impl From<ObjectBuilder> for RefOr<Schema>
Source§fn from(builder: ObjectBuilder) -> Self
fn from(builder: ObjectBuilder) -> Self
Converts to this type from the input type.
Source§impl From<OneOfBuilder> for RefOr<Schema>
impl From<OneOfBuilder> for RefOr<Schema>
Source§fn from(one_of: OneOfBuilder) -> Self
fn from(one_of: OneOfBuilder) -> Self
Converts to this type from the input type.
Source§impl From<RefBuilder> for RefOr<Schema>
impl From<RefBuilder> for RefOr<Schema>
Source§fn from(builder: RefBuilder) -> Self
fn from(builder: RefBuilder) -> Self
Converts to this type from the input type.
Source§impl<T> From<RefOr<T>> for AdditionalProperties<T>
impl<T> From<RefOr<T>> for AdditionalProperties<T>
Source§impl From<ResponseBuilder> for RefOr<Response>
impl From<ResponseBuilder> for RefOr<Response>
Source§fn from(builder: ResponseBuilder) -> Self
fn from(builder: ResponseBuilder) -> Self
Converts to this type from the input type.
impl<T: Eq> Eq for RefOr<T>
impl<T> StructuralPartialEq for RefOr<T>
Auto Trait Implementations§
impl<T> Freeze for RefOr<T>where
T: Freeze,
impl<T> RefUnwindSafe for RefOr<T>where
T: RefUnwindSafe,
impl<T> Send for RefOr<T>where
T: Send,
impl<T> Sync for RefOr<T>where
T: Sync,
impl<T> Unpin for RefOr<T>where
T: Unpin,
impl<T> UnwindSafe for RefOr<T>where
T: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.