[][src]Enum abi_stable::sabi_types::MaybeCmp

#[repr(u8)]pub enum MaybeCmp<T> {
    Just(T),
    Nothing,
}

An Option-like type which only compares equal if it contains a value(the Just variant).

Example

use abi_stable::sabi_types::MaybeCmp;

assert_eq!( MaybeCmp::Just(10), MaybeCmp::Just(10) );

assert_ne!( MaybeCmp::Just(0), MaybeCmp::Just(10) );
assert_ne!( MaybeCmp::Just(0), MaybeCmp::Nothing );
assert_ne!( MaybeCmp::Nothing, MaybeCmp::Just(0) );
assert_ne!( MaybeCmp::<u32>::Nothing, MaybeCmp::Nothing );

Variants

Just(T)
Nothing

Trait Implementations

impl<T: Clone> Clone for MaybeCmp<T>[src]

impl<T: Copy> Copy for MaybeCmp<T>[src]

impl<T: Debug> Debug for MaybeCmp<T>[src]

impl<T> Eq for MaybeCmp<T> where
    T: Eq
[src]

impl<T> GetStaticEquivalent_ for MaybeCmp<T> where
    T: __StableAbi
[src]

type StaticEquivalent = _static_MaybeCmp<__GetStaticEquivalent<T>>

impl<T: Hash> Hash for MaybeCmp<T>[src]

impl<T> PartialEq<MaybeCmp<T>> for MaybeCmp<T> where
    T: PartialEq
[src]

impl<T> PartialOrd<MaybeCmp<T>> for MaybeCmp<T> where
    T: PartialOrd
[src]

impl<T> StableAbi for MaybeCmp<T> where
    T: __StableAbi
[src]

type IsNonZeroType = False

Whether this type has a single invalid bit-pattern. Read more

Auto Trait Implementations

impl<T> RefUnwindSafe for MaybeCmp<T> where
    T: RefUnwindSafe

impl<T> Send for MaybeCmp<T> where
    T: Send

impl<T> Sync for MaybeCmp<T> where
    T: Sync

impl<T> Unpin for MaybeCmp<T> where
    T: Unpin

impl<T> UnwindSafe for MaybeCmp<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> BorrowOwned<'a> for T where
    T: 'a + Clone
[src]

type ROwned = T

The owned type, stored in RCow::Owned

type RBorrowed = &'a T

The borrowed type, stored in RCow::Borrowed

impl<T> From<T> for T[src]

impl<T> GetWithMetadata for T[src]

type ForSelf = WithMetadata_<T, T>

This is always WithMetadata_<Self, Self>

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SelfOps for T where
    T: ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<This> TransmuteElement for This where
    This: ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The error type returned when the conversion fails.

impl<T> TypeIdentity for T where
    T: ?Sized
[src]

type Type = T

The same type as Self. Read more

impl<This> ValidTag_Bounds for This where
    This: Debug + Clone + PartialEq<This>, 
[src]