Enum rustpython_vm::bytecode::BorrowedConstant
source · 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> RefUnwindSafe for BorrowedConstant<'a, C>where C: RefUnwindSafe, <C as Constant>::Name: RefUnwindSafe,
impl<'a, C> Send for BorrowedConstant<'a, C>where C: Sync, <C as Constant>::Name: Sync,
impl<'a, C> Sync for BorrowedConstant<'a, C>where C: Sync, <C as Constant>::Name: Sync,
impl<'a, C> Unpin for BorrowedConstant<'a, C>
impl<'a, C> UnwindSafe for BorrowedConstant<'a, C>where C: RefUnwindSafe, <C as Constant>::Name: RefUnwindSafe,
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