[−][src]Enum duk::Value
A Javascript/Ecmascript value that exists in the Rust world.
Duktape supports values beyond these, but they don't have good Rust semantics, so they cannot be
interacted with from the Rust world. They are therefore mapped to Value::Foreign
when
retrieved, and trying to further use those values is generally equivalent to using undefined
.
Variants
The undefined
value.
The null
value.
Boolean(bool)
A boolean like true
or false
.
Number(f64)
Any number (both integral like 5
and fractional like 2.3
).
String(String)
Any string like 'abc'
.
Any array of values like ['a', 2, false]
.
A JSON-like object like {a: 'a', b: 2, c: false}
.
A Duktape byte buffer like Duktape.Buffer('abc')
.
Foreign(&'static str)
A Duktape value that cannot be represented in Rust (yet).
Contains a &str
describing the foreign type.
Methods
impl Value
[src]
pub fn to_reference<'a>(&self, context: &'a Context) -> Reference<'a>
[src]
Copies this value into a Context
, and returns the reference to the value within the
context.
Trait Implementations
impl Argument for Value
[src]
unsafe fn push_to_context(&self, context: &Context)
[src]
impl Clone for Value
[src]
impl Debug for Value
[src]
impl PartialEq<Value> for Value
[src]
impl StructuralPartialEq for Value
[src]
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,