pub enum ConstExpression {
Show 15 variants
Integer(u128),
Named(String),
Add(Box<Self>, Box<Self>),
Subtract(Box<Self>, Box<Self>),
Multiply(Box<Self>, Box<Self>),
Divide(Box<Self>, Box<Self>),
Modulo(Box<Self>, Box<Self>),
BitwiseAnd(Box<Self>, Box<Self>),
BitwiseOr(Box<Self>, Box<Self>),
BitwiseXor(Box<Self>, Box<Self>),
ShiftLeft(Box<Self>, Box<Self>),
ShiftRight(Box<Self>, Box<Self>),
Call(String, Vec<Self>),
Field(Box<Self>, String),
Construction(Vec<(String, Self)>),
}Expand description
A compile-time constant expression used in types (array lengths, const generics).
Variants§
Integer(u128)
Integer literal.
Named(String)
Named constant or const parameter.
Add(Box<Self>, Box<Self>)
Addition.
Subtract(Box<Self>, Box<Self>)
Subtraction.
Multiply(Box<Self>, Box<Self>)
Multiplication.
Divide(Box<Self>, Box<Self>)
Division.
Modulo(Box<Self>, Box<Self>)
Remainder.
BitwiseAnd(Box<Self>, Box<Self>)
Bitwise AND.
BitwiseOr(Box<Self>, Box<Self>)
Bitwise OR.
BitwiseXor(Box<Self>, Box<Self>)
Bitwise XOR.
ShiftLeft(Box<Self>, Box<Self>)
Left shift.
ShiftRight(Box<Self>, Box<Self>)
Right shift.
Call(String, Vec<Self>)
Const function call.
Field(Box<Self>, String)
Field access on a const expression.
Construction(Vec<(String, Self)>)
Named tuple construction ({ rows: 3, columns: 3 }).
Trait Implementations§
Source§impl Clone for ConstExpression
impl Clone for ConstExpression
Source§fn clone(&self) -> ConstExpression
fn clone(&self) -> ConstExpression
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConstExpression
impl Debug for ConstExpression
Source§impl PartialEq for ConstExpression
impl PartialEq for ConstExpression
Source§fn eq(&self, other: &ConstExpression) -> bool
fn eq(&self, other: &ConstExpression) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ConstExpression
impl StructuralPartialEq for ConstExpression
Auto Trait Implementations§
impl Freeze for ConstExpression
impl RefUnwindSafe for ConstExpression
impl Send for ConstExpression
impl Sync for ConstExpression
impl Unpin for ConstExpression
impl UnsafeUnpin for ConstExpression
impl UnwindSafe for ConstExpression
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