Struct rquickjs_core::Value[][src]

pub struct Value<'js> { /* fields omitted */ }

Any javascript value

Implementations

impl<'js> Value<'js>[src]

pub fn new_uninitialized(ctx: Ctx<'js>) -> Self[src]

pub fn new_undefined(ctx: Ctx<'js>) -> Self[src]

pub fn new_null(ctx: Ctx<'js>) -> Self[src]

pub fn new_bool(ctx: Ctx<'js>, value: bool) -> Self[src]

Create new boolean value

pub fn as_bool(&self) -> Option<bool>[src]

Try get bool from value

pub fn new_int(ctx: Ctx<'js>, value: i32) -> Self[src]

Create new int value

pub fn as_int(&self) -> Option<i32>[src]

Try get int from value

pub fn new_float(ctx: Ctx<'js>, value: f64) -> Self[src]

Create new float value

pub fn as_float(&self) -> Option<f64>[src]

Try get float from value

pub fn new_number(ctx: Ctx<'js>, value: f64) -> Self[src]

Create a new number value

pub fn as_number(&self) -> Option<f64>[src]

Try get any number from value

pub fn is_bool(&self) -> bool[src]

Check if the value is a bool

pub fn is_int(&self) -> bool[src]

Check if the value is an int

pub fn is_float(&self) -> bool[src]

Check if the value is a float

pub fn is_number(&self) -> bool[src]

Check if the value is an any number

pub fn is_string(&self) -> bool[src]

Check if the value is a string

pub fn is_symbol(&self) -> bool[src]

Check if the value is a symbol

pub fn is_object(&self) -> bool[src]

Check if the value is an object

pub fn is_module(&self) -> bool[src]

Check if the value is a module

pub fn is_array(&self) -> bool[src]

Check if the value is an array

pub fn is_function(&self) -> bool[src]

Check if the value is a function

pub fn is_error(&self) -> bool[src]

Check if the value is an error

pub fn as_value(&self) -> &Self[src]

Reference as value

pub fn get<T: FromJs<'js>>(&self) -> Result<T>[src]

Convert from value to specified type

impl<'js> Value<'js>[src]

pub fn type_of(&self) -> Type[src]

Get the type of value

pub fn type_name(&self) -> &'static str[src]

Get the name of type

impl<'js> Value<'js>[src]

pub unsafe fn ref_string(&self) -> &String<'js>[src]

Interprete as

Safety

You should be sure that the value already is of required type before to do it.

pub fn as_string(&self) -> Option<&String<'js>>[src]

Try reinterprete as

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

Try convert into

pub fn from_string(value: String<'js>) -> Self[src]

Convert from

impl<'js> Value<'js>[src]

pub unsafe fn ref_symbol(&self) -> &Symbol<'js>[src]

Interprete as

Safety

You should be sure that the value already is of required type before to do it.

pub fn as_symbol(&self) -> Option<&Symbol<'js>>[src]

Try reinterprete as

pub fn into_symbol(self) -> Option<Symbol<'js>>[src]

Try convert into

pub fn from_symbol(value: Symbol<'js>) -> Self[src]

Convert from

impl<'js> Value<'js>[src]

pub unsafe fn ref_object(&self) -> &Object<'js>[src]

Interprete as

Safety

You should be sure that the value already is of required type before to do it.

pub fn as_object(&self) -> Option<&Object<'js>>[src]

Try reinterprete as

pub fn into_object(self) -> Option<Object<'js>>[src]

Try convert into

pub fn from_object(value: Object<'js>) -> Self[src]

Convert from

impl<'js> Value<'js>[src]

pub unsafe fn ref_array(&self) -> &Array<'js>[src]

Interprete as

Safety

You should be sure that the value already is of required type before to do it.

pub fn as_array(&self) -> Option<&Array<'js>>[src]

Try reinterprete as

pub fn into_array(self) -> Option<Array<'js>>[src]

Try convert into

pub fn from_array(value: Array<'js>) -> Self[src]

Convert from

impl<'js> Value<'js>[src]

pub unsafe fn ref_function(&self) -> &Function<'js>[src]

Interprete as

Safety

You should be sure that the value already is of required type before to do it.

pub fn as_function(&self) -> Option<&Function<'js>>[src]

Try reinterprete as

pub fn into_function(self) -> Option<Function<'js>>[src]

Try convert into

pub fn from_function(value: Function<'js>) -> Self[src]

Convert from

impl<'js> Value<'js>[src]

pub unsafe fn ref_module(&self) -> &Module<'js, Evaluated>[src]

Interprete as

Safety

You should be sure that the value already is of required type before to do it.

pub fn as_module(&self) -> Option<&Module<'js, Evaluated>>[src]

Try reinterprete as

pub fn into_module(self) -> Option<Module<'js, Evaluated>>[src]

Try convert into

pub fn from_module(value: Module<'js, Evaluated>) -> Self[src]

Convert from

Trait Implementations

impl<'js> AsRef<Value<'js>> for String<'js>[src]

impl<'js> AsRef<Value<'js>> for Symbol<'js>[src]

impl<'js> AsRef<Value<'js>> for Object<'js>[src]

impl<'js> AsRef<Value<'js>> for Array<'js>[src]

impl<'js> AsRef<Value<'js>> for Function<'js>[src]

impl<'js> AsRef<Value<'js>> for Module<'js, Evaluated>[src]

impl<'js, C> AsRef<Value<'js>> for Class<'js, C>[src]

impl<'js> Clone for Value<'js>[src]

impl<'js> Debug for Value<'js>[src]

impl<'js> Drop for Value<'js>[src]

impl<'js> From<Array<'js>> for Value<'js>[src]

impl<'js> From<Function<'js>> for Value<'js>[src]

impl<'js> From<Module<'js, Evaluated>> for Value<'js>[src]

impl<'js> From<Object<'js>> for Value<'js>[src]

impl<'js> From<String<'js>> for Value<'js>[src]

impl<'js> From<Symbol<'js>> for Value<'js>[src]

impl<'js> FromAtom<'js> for Value<'js>[src]

impl<'js> FromJs<'js> for Value<'js>[src]

impl<'js> IntoAtom<'js> for Value<'js>[src]

impl<'js> IntoJs<'js> for Value<'js>[src]

impl<'js, 't> Outlive<'t> for Value<'js>[src]

type Target = Value<'t>

The target which has the same type as a Self but with another lifetime 't

impl<'js> PartialEq<Value<'js>> for Value<'js>[src]

Auto Trait Implementations

impl<'js> !RefUnwindSafe for Value<'js>[src]

impl<'js> !Send for Value<'js>[src]

impl<'js> !Sync for Value<'js>[src]

impl<'js> Unpin for Value<'js>[src]

impl<'js> UnwindSafe for Value<'js>[src]

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.