pub enum BorrowedConstant<'a, C: Constant> {
    Integer {
        value: &'a BigInt,
    },
    Float {
        value: f64,
    },
    Complex {
        value: Complex64,
    },
    Boolean {
        value: bool,
    },
    Str {
        value: &'a str,
    },
    Bytes {
        value: &'a [u8],
    },
    Code {
        code: &'a CodeObject<C>,
    },
    Tuple {
        elements: &'a [C],
    },
    None,
    Ellipsis,
}
Expand description

A borrowed Constant

Variants§

§

Integer

Fields

§value: &'a BigInt
§

Float

Fields

§value: f64
§

Complex

Fields

§

Boolean

Fields

§value: bool
§

Str

Fields

§value: &'a str
§

Bytes

Fields

§value: &'a [u8]
§

Code

Fields

§code: &'a CodeObject<C>
§

Tuple

Fields

§elements: &'a [C]
§

None

§

Ellipsis

Implementations§

source§

impl<C: Constant> BorrowedConstant<'_, C>

source

pub fn fmt_display(&self, f: &mut Formatter<'_>) -> Result

source

pub fn to_owned(self) -> ConstantData

Trait Implementations§

source§

impl<C: Constant> Clone for BorrowedConstant<'_, C>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, C: Constant> From<BorrowedConstant<'a, C>> for DumpableValue<'a, C>

source§

fn from(c: BorrowedConstant<'a, C>) -> Self

Converts to this type from the input type.
source§

impl<C: Constant> Copy for BorrowedConstant<'_, C>

Auto Trait Implementations§

§

impl<'a, C> Freeze for BorrowedConstant<'a, C>

§

impl<'a, C> RefUnwindSafe for BorrowedConstant<'a, C>

§

impl<'a, C> Send for BorrowedConstant<'a, C>
where <C as Constant>::Name: Sync, C: Sync,

§

impl<'a, C> Sync for BorrowedConstant<'a, C>
where <C as Constant>::Name: Sync, C: Sync,

§

impl<'a, C> Unpin for BorrowedConstant<'a, C>

§

impl<'a, C> UnwindSafe for BorrowedConstant<'a, C>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> ExactFrom<T> for U
where U: TryFrom<T>,

source§

fn exact_from(value: T) -> U

source§

impl<T, U> ExactInto<U> for T
where U: ExactFrom<T>,

source§

fn exact_into(self) -> U

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> OverflowingInto<U> for T
where U: OverflowingFrom<T>,

source§

impl<T, U> RoundingInto<U> for T
where U: RoundingFrom<T>,

source§

impl<T, U> SaturatingInto<U> for T
where U: SaturatingFrom<T>,

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T, U> WrappingInto<U> for T
where U: WrappingFrom<T>,

source§

fn wrapping_into(self) -> U