[][src]Enum abi_stable::sabi_types::ConstructorOrValue

#[repr(u8)]
pub enum ConstructorOrValue<T> {
    Constructor(Constructor<T>),
    Value(T),
}

Either the constructor for a value or the value itself

Variants

Constructor(Constructor<T>)

This is an extern "C" fn()->T which is used to construct a value of type T

Value(T)

A value of type T

Methods

impl<T> ConstructorOrValue<T>[src]

pub fn get(&mut self) -> &T[src]

Gets the wrapped value,computing it from its constructor if this is the Constructor variant

Trait Implementations

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

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

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

type StaticEquivalent = _static_ConstructorOrValue<__GetStaticEquivalent<T>>

impl<T> SharedStableAbi for ConstructorOrValue<T> where
    T: __StableAbi
[src]

type IsNonZeroType = False

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

type Kind = __ValueKind

The kind of abi stability of this type,there are 2: Read more

Auto Trait Implementations

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

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

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

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

impl<T> UnwindSafe for ConstructorOrValue<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

type RBorrowed = &'a T

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

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

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

impl<This> StableAbi for This where
    This: SharedStableAbi<Kind = ValueKind>, 
[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