pub enum ReferenceOr<T> {
Reference {
reference: String,
},
Item(T),
}
Variants§
Reference
A simple object to allow referencing other components in the specification, internally and externally.
The Reference Object is defined by JSON Reference and follows the same structure, behavior and rules. A JSON Reference SHALL only be used to refer to a schema that is formatted in either JSON or YAML. In the case of a YAML-formatted Schema, the JSON Reference SHALL be applied to the JSON representation of that schema. The JSON representation SHALL be made by applying the conversion described here.
For this specification, reference resolution is done as defined by the JSON Reference specification and not by the JSON Schema specification.
Item(T)
Implementations§
Source§impl<T> ReferenceOr<T>
impl<T> ReferenceOr<T>
pub fn ref_(r: &str) -> Self
pub fn boxed_item(item: T) -> ReferenceOr<Box<T>>
Source§impl<T> ReferenceOr<Box<T>>
impl<T> ReferenceOr<Box<T>>
pub fn unbox(self) -> ReferenceOr<T>
Trait Implementations§
Source§impl<T: Clone> Clone for ReferenceOr<T>
impl<T: Clone> Clone for ReferenceOr<T>
Source§fn clone(&self) -> ReferenceOr<T>
fn clone(&self) -> ReferenceOr<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for ReferenceOr<T>
impl<T: Debug> Debug for ReferenceOr<T>
Source§impl<'de, T> Deserialize<'de> for ReferenceOr<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ReferenceOr<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<T: PartialEq> PartialEq for ReferenceOr<T>
impl<T: PartialEq> PartialEq for ReferenceOr<T>
Source§impl<T> Serialize for ReferenceOr<T>where
T: Serialize,
impl<T> Serialize for ReferenceOr<T>where
T: Serialize,
impl<T> StructuralPartialEq for ReferenceOr<T>
Auto Trait Implementations§
impl<T> Freeze for ReferenceOr<T>where
T: Freeze,
impl<T> RefUnwindSafe for ReferenceOr<T>where
T: RefUnwindSafe,
impl<T> Send for ReferenceOr<T>where
T: Send,
impl<T> Sync for ReferenceOr<T>where
T: Sync,
impl<T> Unpin for ReferenceOr<T>where
T: Unpin,
impl<T> UnwindSafe for ReferenceOr<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