Enum quick_js::JsValue[][src]

pub enum JsValue {
    Undefined,
    Null,
    Bool(bool),
    Int(i32),
    Float(f64),
    String(String),
    Array(Vec<JsValue>),
    Object(HashMap<String, JsValue>),
    Date(DateTime<Utc>),
    BigInt(BigInt),
    // some variants omitted
}

A value that can be (de)serialized to/from the quickjs runtime.

Variants

Undefined
Null
Bool(bool)
Int(i32)
Float(f64)
String(String)
Array(Vec<JsValue>)
Date(DateTime<Utc>)

chrono::Datetime / JS Date integration. Only available with the optional chrono feature.

BigInt(BigInt)

num_bigint::BigInt / JS BigInt integration Only available with the optional bigint feature

Implementations

impl JsValue[src]

pub fn as_str(&self) -> Option<&str>[src]

Cast value to a str.

Returns Some(&str) if value is a JsValue::String, None otherwise.

pub fn into_string(self) -> Option<String>[src]

Convert to String.

Trait Implementations

impl Clone for JsValue[src]

impl Debug for JsValue[src]

impl<'a> From<&'a str> for JsValue[src]

impl From<BigInt> for JsValue[src]

impl<K, V> From<HashMap<K, V, RandomState>> for JsValue where
    K: Into<String>,
    V: Into<JsValue>, 
[src]

impl<T> From<Option<T>> for JsValue where
    T: Into<JsValue>, 
[src]

impl From<String> for JsValue[src]

impl<T> From<Vec<T, Global>> for JsValue where
    T: Into<JsValue>, 
[src]

impl From<bool> for JsValue[src]

impl From<f64> for JsValue[src]

impl From<i128> for JsValue[src]

impl From<i16> for JsValue[src]

impl From<i32> for JsValue[src]

impl From<i64> for JsValue[src]

impl From<i8> for JsValue[src]

impl From<u128> for JsValue[src]

impl From<u16> for JsValue[src]

impl From<u32> for JsValue[src]

impl From<u64> for JsValue[src]

impl From<u8> for JsValue[src]

impl PartialEq<JsValue> for JsValue[src]

impl StructuralPartialEq for JsValue[src]

Auto Trait Implementations

impl RefUnwindSafe for JsValue

impl Send for JsValue

impl Sync for JsValue

impl Unpin for JsValue

impl UnwindSafe for JsValue

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.