pub enum OneOf<A, B> {
A(A),
B(B),
}Expand description
An A, else a B, read from the same value.
Variants§
Trait Implementations§
Source§impl<'de, A: Deserialize<'de>, B: Deserialize<'de>> Deserialize<'de> for OneOf<A, B>
impl<'de, A: Deserialize<'de>, B: Deserialize<'de>> Deserialize<'de> for OneOf<A, B>
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl<A: JsonSchema, B: JsonSchema> JsonSchema for OneOf<A, B>
impl<A: JsonSchema, B: JsonSchema> JsonSchema for OneOf<A, B>
Source§fn json_schema(g: &mut SchemaGenerator) -> Schema
fn json_schema(g: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl<A: PartialEq, B: PartialEq> StructuralPartialEq for OneOf<A, B>
Auto Trait Implementations§
impl<A, B> Freeze for OneOf<A, B>
impl<A, B> RefUnwindSafe for OneOf<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for OneOf<A, B>
impl<A, B> Sync for OneOf<A, B>
impl<A, B> Unpin for OneOf<A, B>
impl<A, B> UnsafeUnpin for OneOf<A, B>where
A: UnsafeUnpin,
B: UnsafeUnpin,
impl<A, B> UnwindSafe for OneOf<A, B>where
A: UnwindSafe,
B: UnwindSafe,
Blanket Implementations§
impl<T> Allocation for T
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