swc_ecma_utils

Type Alias BoolValue

source
pub type BoolValue = Value<bool>;

Aliased Type§

enum BoolValue {
    Known(bool),
    Unknown,
}

Variants§

§

Known(bool)

§

Unknown

Not determined at compile time.`

Implementations

source§

impl<T> Value<T>

source

pub fn into_result(self) -> Result<T, UnknownError>

source§

impl<T> Value<T>

source

pub fn is_unknown(&self) -> bool

Returns true if the value is not known.

source

pub fn is_known(&self) -> bool

Returns true if the value is known.

source§

impl Value<bool>

source

pub fn and(self, other: Self) -> Self

source

pub fn or(self, other: Self) -> Self

Trait Implementations

source§

impl<T: Clone> Clone for Value<T>

source§

fn clone(&self) -> Value<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for Value<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Hash> Hash for Value<T>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Not for Value<bool>

source§

type Output = Value<bool>

The resulting type after applying the ! operator.
source§

fn not(self) -> Self

Performs the unary ! operation. Read more
source§

impl<T: Ord> Ord for Value<T>

source§

fn cmp(&self, other: &Value<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
source§

impl<T: PartialEq> PartialEq for Value<T>

source§

fn eq(&self, other: &Value<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: PartialOrd> PartialOrd for Value<T>

source§

fn partial_cmp(&self, other: &Value<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T: Copy> Copy for Value<T>

source§

impl<T: Eq> Eq for Value<T>

source§

impl<T> StructuralPartialEq for Value<T>