pub enum OneOf<A, B> {
Left(A),
Right(B),
}
Variants§
Trait Implementations§
§impl<'de, A, B> Deserialize<'de> for OneOf<A, B>where
A: Deserialize<'de>,
B: Deserialize<'de>,
impl<'de, A, B> Deserialize<'de> for OneOf<A, B>where A: Deserialize<'de>, B: Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D
) -> Result<OneOf<A, B>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<OneOf<A, B>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<A, B> Ord for OneOf<A, B>where
A: Ord,
B: Ord,
impl<A, B> Ord for OneOf<A, B>where A: Ord, B: Ord,
§impl<A, B> PartialEq<OneOf<A, B>> for OneOf<A, B>where
A: PartialEq<A>,
B: PartialEq<B>,
impl<A, B> PartialEq<OneOf<A, B>> for OneOf<A, B>where A: PartialEq<A>, B: PartialEq<B>,
§impl<A, B> PartialOrd<OneOf<A, B>> for OneOf<A, B>where
A: PartialOrd<A>,
B: PartialOrd<B>,
impl<A, B> PartialOrd<OneOf<A, B>> for OneOf<A, B>where A: PartialOrd<A>, B: PartialOrd<B>,
§fn partial_cmp(&self, other: &OneOf<A, B>) -> Option<Ordering>
fn partial_cmp(&self, other: &OneOf<A, B>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more§impl<A, B> Serialize for OneOf<A, B>where
A: Serialize,
B: Serialize,
impl<A, B> Serialize for OneOf<A, B>where A: Serialize, B: Serialize,
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<A, B> Eq for OneOf<A, B>where A: Eq, B: Eq,
impl<A, B> StructuralEq for OneOf<A, B>
impl<A, B> StructuralPartialEq for OneOf<A, B>
Auto Trait Implementations§
impl<A, B> RefUnwindSafe for OneOf<A, B>where A: RefUnwindSafe, B: RefUnwindSafe,
impl<A, B> Send for OneOf<A, B>where A: Send, B: Send,
impl<A, B> Sync for OneOf<A, B>where A: Sync, B: Sync,
impl<A, B> Unpin for OneOf<A, B>where A: Unpin, B: Unpin,
impl<A, B> UnwindSafe for OneOf<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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.