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§
Implementations§
source§impl<C: Constant> BorrowedConstant<'_, C>
impl<C: Constant> BorrowedConstant<'_, C>
pub fn fmt_display(&self, f: &mut Formatter<'_>) -> Result
pub fn to_owned(self) -> ConstantData
Trait Implementations§
source§impl<C: Constant> Clone for BorrowedConstant<'_, C>
impl<C: Constant> Clone for BorrowedConstant<'_, C>
source§impl<'a, C: Constant> From<BorrowedConstant<'a, C>> for DumpableValue<'a, C>
impl<'a, C: Constant> From<BorrowedConstant<'a, C>> for DumpableValue<'a, C>
source§fn from(c: BorrowedConstant<'a, C>) -> Self
fn from(c: BorrowedConstant<'a, C>) -> Self
Converts to this type from the input type.
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>
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