pub struct ConstDecl {
pub name: Ident,
pub ty: TypeExpr,
pub value: Box<Expr>,
pub span: Span,
}Expand description
A compile-time constant declaration: const PI: f64 = 3.14159;
Constants must have an explicit type annotation and a value expression that can be evaluated at compile time.
Fields§
§name: IdentConstant name.
ty: TypeExprType annotation (required).
value: Box<Expr>Value expression (must be compile-time evaluable).
span: SpanSource span of the full declaration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConstDecl
impl RefUnwindSafe for ConstDecl
impl Send for ConstDecl
impl Sync for ConstDecl
impl Unpin for ConstDecl
impl UnsafeUnpin for ConstDecl
impl UnwindSafe for ConstDecl
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