Struct moore_vhdl::hir::LitExpr
source · [−]pub struct LitExpr { /* private fields */ }
Expand description
A literal expression.
Implementations
sourceimpl LitExpr
impl LitExpr
sourcepub fn new_integer(span: Span, value: BigInt) -> LitExpr
pub fn new_integer(span: Span, value: BigInt) -> LitExpr
Create a new integer literal expression.
sourcepub fn new_float(span: Span, value: BigRational) -> LitExpr
pub fn new_float(span: Span, value: BigRational) -> LitExpr
Create a new float literal expression.
sourcepub fn value(&self) -> &LitExprValue
pub fn value(&self) -> &LitExprValue
Return the constant value of the literal.
sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Check if this is an integer literal.
sourcepub fn integer_value(&self) -> Option<&BigInt>
pub fn integer_value(&self) -> Option<&BigInt>
Return the literal’s integer value, or None
if it is not an integer.
sourcepub fn float_value(&self) -> Option<&BigRational>
pub fn float_value(&self) -> Option<&BigRational>
Return the literal’s float value, or None
if it is not an float.
Trait Implementations
sourceimpl<'t> Expr2<'t> for LitExpr
impl<'t> Expr2<'t> for LitExpr
sourcefn typeval(
&self,
_: Option<&'t dyn Type>,
_: &dyn ExprContext<'t>
) -> Result<&'t dyn Type>
fn typeval(
&self,
_: Option<&'t dyn Type>,
_: &dyn ExprContext<'t>
) -> Result<&'t dyn Type>
Determine the type of the expression.
sourcefn constant_value(
&self,
ctx: &dyn ExprContext<'t>
) -> Result<&'t dyn Const2<'t>>
fn constant_value(
&self,
ctx: &dyn ExprContext<'t>
) -> Result<&'t dyn Const2<'t>>
Determine the constant value of the expression. Read more
Auto Trait Implementations
impl RefUnwindSafe for LitExpr
impl Send for LitExpr
impl Sync for LitExpr
impl Unpin for LitExpr
impl UnwindSafe for LitExpr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more