pub enum Constant {
Number(f64),
String(Wtf8),
BigInt {
digits: String,
radix: u32,
},
Function(Box<Function>),
Template {
cooked: Vec<Option<Wtf8>>,
raw: Vec<String>,
},
}Expand description
A constant in the pool.
Variants§
Number(f64)
A number.
String(Wtf8)
A string.
A Wtf8 for the same reason an atom is one: the literal may hold an unpaired
surrogate, and the constant is the literal.
BigInt
A BigInt literal: digits and radix.
Function(Box<Function>)
A nested function, referenced by fclosure.
Template
A template object: one call site’s chunks.
The raw text is carried as well as the cooked text because String.raw reads
it back verbatim, and a tagged template may legally contain an invalid escape
sequence whose cooked form is undefined.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Constant
Auto Trait Implementations§
impl !Send for Constant
impl !Sync for Constant
impl Forget for Constant
impl Freeze for Constantwhere
*const RcInner<[u8]> is !null: Freeze,
PhantomData<RcInner<[u8]>>: Freeze,
*const RcInner<Vec<u8>> is !null: Freeze,
PhantomData<RcInner<Vec<u8>>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const Function is !null: Freeze,
PhantomData<Function>: Freeze,
PhantomData<Option<Wtf8>>: Freeze,
PhantomData<String>: Freeze,
impl Move for Constant
impl RefUnwindSafe for Constant
impl Unpin for Constant
impl UnsafeUnpin for Constantwhere
*const RcInner<[u8]> is !null: UnsafeUnpin,
PhantomData<RcInner<[u8]>>: UnsafeUnpin,
*const RcInner<Vec<u8>> is !null: UnsafeUnpin,
PhantomData<RcInner<Vec<u8>>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const Function is !null: UnsafeUnpin,
PhantomData<Function>: UnsafeUnpin,
PhantomData<Option<Wtf8>>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for Constantwhere
Rc<[u8]>: UnwindSafe,
Rc<Vec<u8>>: UnwindSafe,
RawVecInner: UnwindSafe,
BoxRaw<Function>: UnwindSafe,
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