pub enum Constant<M = String> {
None,
Some(Box<Constant<M>>),
Bool(bool),
Int(Int),
Decimal(Decimal),
Text(String),
Tuple(Vec<Constant<M>>),
Constructor(String),
Applied {
newtype: TypeRef<M>,
value: Box<Constant<M>>,
},
}Expand description
A parameter’s default: a constant of the parameter’s type.
Variants§
None
None.
Some(Box<Constant<M>>)
Some of a constant.
Bool(bool)
true or false.
Int(Int)
An integer, such as -5.
Decimal(Decimal)
A decimal number, written with a point, such as 1.5 or 2.0.
Text(String)
A text, written as a literal with the escapes it needs.
Tuple(Vec<Constant<M>>)
A tuple of constants.
Constructor(String)
A payload-free constructor, such as Ready.
Applied
A newtype’s constructor applied to a constant of its base.
Implementations§
Trait Implementations§
impl<M: Eq> Eq for Constant<M>
impl<M: PartialEq> StructuralPartialEq for Constant<M>
Auto Trait Implementations§
impl<M> Forget for Constant<M>
impl<M> Freeze for Constant<M>where
*const Constant<M> is !null: Freeze,
PhantomData<Constant<M>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u64>: Freeze,
PhantomData<u8>: Freeze,
M: Freeze,
PhantomData<TypeRef<M>>: Freeze,
impl<M> Move for Constant<M>
impl<M> RefUnwindSafe for Constant<M>where
M: RefUnwindSafe,
impl<M> Send for Constant<M>
impl<M> Sync for Constant<M>
impl<M> Unpin for Constant<M>
impl<M> UnsafeUnpin for Constant<M>where
*const Constant<M> is !null: UnsafeUnpin,
PhantomData<Constant<M>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u64>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
M: UnsafeUnpin,
PhantomData<TypeRef<M>>: UnsafeUnpin,
impl<M> UnwindSafe for Constant<M>
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