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<S: IsComplete> From<ExampleBuilder<S>> for RefOr<Example>
impl<S: IsComplete> From<ExampleBuilder<S>> for RefOr<Example>
Source§fn from(builder: ExampleBuilder<S>) -> Self
fn from(builder: ExampleBuilder<S>) -> Self
Converts to this type from the input type.
Source§impl<S: IsComplete> From<ResponseBuilder<S>> for RefOr<Response>
impl<S: IsComplete> From<ResponseBuilder<S>> for RefOr<Response>
Source§fn from(builder: ResponseBuilder<S>) -> Self
fn from(builder: ResponseBuilder<S>) -> 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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.