Skip to main content

IsInt32OrUint32

Trait IsInt32OrUint32 

Source
pub trait IsInt32OrUint32<'a> {
    // Required method
    fn is_int32_or_uint32(&self, ctx: &impl GlobalContext<'a>) -> bool;
}

Required Methods§

Source

fn is_int32_or_uint32(&self, ctx: &impl GlobalContext<'a>) -> bool

Whether the value of the expression is a int32 or uint32. If this method returns true, we know that the value cannot be NaN or Infinity.

  • true means it is int32 or uint32.
  • false means it is neither int32 nor uint32, or it is unknown.

Based on https://github.com/evanw/esbuild/blob/v0.25.0/internal/js_ast/js_ast_helpers.go#L950

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'a> IsInt32OrUint32<'a> for Expression<'a>

Source§

fn is_int32_or_uint32(&self, ctx: &impl GlobalContext<'a>) -> bool

Source§

impl<'a> IsInt32OrUint32<'a> for BinaryExpression<'a>

Source§

fn is_int32_or_uint32(&self, ctx: &impl GlobalContext<'a>) -> bool

Source§

impl<'a> IsInt32OrUint32<'a> for LogicalExpression<'a>

Source§

fn is_int32_or_uint32(&self, ctx: &impl GlobalContext<'a>) -> bool

Source§

impl<'a> IsInt32OrUint32<'a> for UnaryExpression<'a>

Source§

fn is_int32_or_uint32(&self, ctx: &impl GlobalContext<'a>) -> bool

Source§

impl<'a> IsInt32OrUint32<'a> for NumericLiteral<'a>

Source§

fn is_int32_or_uint32(&self, _ctx: &impl GlobalContext<'a>) -> bool

Implementors§