pub enum BorrowedConstant<'a, C>where
C: Constant,{
Integer {
value: &'a BigInt,
},
Float {
value: f64,
},
Complex {
value: Complex<f64>,
},
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§
Implementations§
Source§impl<C> BorrowedConstant<'_, C>where
C: Constant,
impl<C> BorrowedConstant<'_, C>where
C: Constant,
pub fn fmt_display(&self, f: &mut Formatter<'_>) -> Result<(), Error>
pub fn to_owned(self) -> ConstantData
Trait Implementations§
Source§impl<C> Clone for BorrowedConstant<'_, C>where
C: Constant,
impl<C> Clone for BorrowedConstant<'_, C>where
C: Constant,
Source§fn clone(&self) -> BorrowedConstant<'_, C>
fn clone(&self) -> BorrowedConstant<'_, C>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a, C> From<BorrowedConstant<'a, C>> for DumpableValue<'a, C>where
C: Constant,
impl<'a, C> From<BorrowedConstant<'a, C>> for DumpableValue<'a, C>where
C: Constant,
Source§fn from(c: BorrowedConstant<'a, C>) -> DumpableValue<'a, C>
fn from(c: BorrowedConstant<'a, C>) -> DumpableValue<'a, C>
Converts to this type from the input type.
impl<C> Copy for BorrowedConstant<'_, C>where
C: Constant,
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>
impl<'a, C> Sync for BorrowedConstant<'a, C>
impl<'a, C> Unpin for BorrowedConstant<'a, C>
impl<'a, C> UnwindSafe for BorrowedConstant<'a, C>
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more