pub enum AnyOf2<A, B>where
A: PartialEq,
B: PartialEq,{
A(A),
B(B),
}
Expand description
AnyOf2
type.
This allows modelling of anyOf JSON schemas.
Variants§
Trait Implementations§
source§impl<'b, A, B> Deserialize<'b> for AnyOf2<A, B>where
A: PartialEq + for<'a> Deserialize<'a>,
B: PartialEq + for<'a> Deserialize<'a>,
impl<'b, A, B> Deserialize<'b> for AnyOf2<A, B>where A: PartialEq + for<'a> Deserialize<'a>, B: PartialEq + for<'a> Deserialize<'a>,
source§fn deserialize<De: Deserializer<'b>>(
deserializer: De
) -> Result<Self, De::Error>
fn deserialize<De: Deserializer<'b>>( deserializer: De ) -> Result<Self, De::Error>
Deserialize this value from the given Serde deserializer. Read more
source§impl<A, B> LabelledGeneric for AnyOf2<A, B>where
A: PartialEq,
B: PartialEq,
impl<A, B> LabelledGeneric for AnyOf2<A, B>where A: PartialEq, B: PartialEq,
§type Repr = HEither<Variant<A, HCons<Field<(__, _0), A>, HNil>>, HEither<Variant<B, HCons<Field<(__, _0), B>, HNil>>, Void>>
type Repr = HEither<Variant<A, HCons<Field<(__, _0), A>, HNil>>, HEither<Variant<B, HCons<Field<(__, _0), B>, HNil>>, Void>>
The labelled generic representation type.
source§fn from(repr: Self::Repr) -> Self
fn from(repr: Self::Repr) -> Self
Convert a value’s labelled representation type
Repr
to the values’s type.source§fn convert_from<Src>(src: Src) -> Selfwhere
Src: LabelledGeneric<Repr = Self::Repr>,
Self: Sized,
fn convert_from<Src>(src: Src) -> Selfwhere Src: LabelledGeneric<Repr = Self::Repr>, Self: Sized,
Convert from one type to another using a type with the same
labelled generic representation
source§fn sculpted_convert_from<A, Indices>(a: A) -> Selfwhere
A: LabelledGeneric,
Self: Sized,
<A as LabelledGeneric>::Repr: Sculptor<Self::Repr, Indices>,
fn sculpted_convert_from<A, Indices>(a: A) -> Selfwhere A: LabelledGeneric, Self: Sized, <A as LabelledGeneric>::Repr: Sculptor<Self::Repr, Indices>,
👎Deprecated: obsolete, transform_from instead
Converts from another type A into Self assuming that A and Self have
labelled generic representations that can be sculpted into each other. Read more
source§fn transform_from<Src, Indices>(src: Src) -> Selfwhere
Src: LabelledGeneric,
Self: Sized,
<Src as LabelledGeneric>::Repr: Sculptor<Self::Repr, Indices>,
fn transform_from<Src, Indices>(src: Src) -> Selfwhere Src: LabelledGeneric, Self: Sized, <Src as LabelledGeneric>::Repr: Sculptor<Self::Repr, Indices>,
Converts from another type
Src
into Self
assuming that Src
and
Self
have labelled generic representations that can be sculpted into
each other. Read moresource§impl<A, B> PartialEq<AnyOf2<A, B>> for AnyOf2<A, B>where
A: PartialEq + PartialEq,
B: PartialEq + PartialEq,
impl<A, B> PartialEq<AnyOf2<A, B>> for AnyOf2<A, B>where A: PartialEq + PartialEq, B: PartialEq + PartialEq,
source§impl<A, B> Serialize for AnyOf2<A, B>where
A: PartialEq + Serialize,
B: PartialEq + Serialize,
impl<A, B> Serialize for AnyOf2<A, B>where A: PartialEq + Serialize, B: PartialEq + Serialize,
impl<A, B> StructuralPartialEq for AnyOf2<A, B>where A: PartialEq, B: PartialEq,
Auto Trait Implementations§
impl<A, B> RefUnwindSafe for AnyOf2<A, B>where A: RefUnwindSafe, B: RefUnwindSafe,
impl<A, B> Send for AnyOf2<A, B>where A: Send, B: Send,
impl<A, B> Sync for AnyOf2<A, B>where A: Sync, B: Sync,
impl<A, B> Unpin for AnyOf2<A, B>where A: Unpin, B: Unpin,
impl<A, B> UnwindSafe for AnyOf2<A, B>where A: UnwindSafe, B: 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<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<A> IntoLabelledGeneric for Awhere
A: LabelledGeneric,
impl<A> IntoLabelledGeneric for Awhere A: LabelledGeneric,
§type Repr = <A as LabelledGeneric>::Repr
type Repr = <A as LabelledGeneric>::Repr
The labelled generic representation type.
source§fn into(self) -> <A as IntoLabelledGeneric>::Repr
fn into(self) -> <A as IntoLabelledGeneric>::Repr
Convert a value to its representation type
Repr
.