[][src]Struct sapp_jsutils::JsObject

#[repr(transparent)]
pub struct JsObject(_);

Pointer type for Js allocated object Consider this as a Box, but pointing into JS memory

Methods

impl JsObject[src]

pub fn weak(&self) -> JsObjectWeak[src]

Get a weak reference to js memory No guarantees against js garbage collector

impl JsObject[src]

pub fn string(string: &str) -> JsObject[src]

Allocate new javascript object with string type

pub fn to_string(&self, buf: &mut String)[src]

Read js object to given string Will not allocate memory is string is large enough, will use "String::reserve" otherwise Will panic if object is not a string

pub fn field(&self, field: &str) -> JsObject[src]

Get a new JsObject from this object .field Will panic if self is not an object or map

Trait Implementations

impl Drop for JsObject[src]

Auto Trait Implementations

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, 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.