Expand description
Conversions of Rust values to and from JSVal
.
IDL type | Argument type | Return type |
---|---|---|
any | JSVal | |
boolean | bool | |
byte | i8 | |
octet | u8 | |
short | i16 | |
unsigned short | u16 | |
long | i32 | |
unsigned long | u32 | |
long long | i64 | |
unsigned long long | u64 | |
unrestricted float | f32 | |
float | Finite<f32> | |
unrestricted double | f64 | |
double | Finite<f64> | |
DOMString | DOMString | |
USVString | USVString | |
ByteString | ByteString | |
object | *mut JSObject | |
interface types | &T | DomRoot<T> |
dictionary types | &T | unsupported |
enumeration types | T | |
callback function types | Rc<T> | |
nullable types | Option<T> | |
sequences | Vec<T> | |
union types | T |
Enumsยง
- Conversion
Behavior ๐ - Behavior for converting out-of-range integers.
- Conversion
Result ๐ - An enum to better support enums through FromJSValConvertible::from_jsval.
- Prototype
Check ๐ - Stringification
Behavior ๐ - Behavior for stringification of
JSVal
s.
Constantsยง
- DOM_
OBJECT_ ๐SLOT - The index of the slot wherein a pointer to the reflected DOM object is stored for non-proxy bindings.
Traitsยง
- Derived
From ๐ - A trait to mark an IDL interface as deriving from another one.
- FromJS
ValConvertible ๐ - A trait to convert
JSVal
s to Rust types. - IDLInterface ๐
- A trait to check whether a given
JSObject
implements an IDL interface. - Safe
FromJS ๐ValConvertible - A safe wrapper for
FromJSValConvertible
. - Safe
ToJS ๐ValConvertible - A safe wrapper for
ToJSValConvertible
. - ToJS
ValConvertible ๐ - A trait to convert Rust types to
JSVal
s.
Functionsยง
- get_
dom_ ๐ โclass - Get the
DOMClass
fromobj
, orErr(())
ifobj
is not a DOM object. - get_
property ๐ - Get a property from a JS object, and convert it to a Rust value.
- get_
property_ ๐jsval - Get a property from a JS object.
- is_
array_ ๐ โlike - Returns whether
value
is an array-like object (Array, FileList, HTMLCollection, HTMLFormControlsCollection, HTMLOptionsCollection, NodeList, DOMTokenList). - is_
dom_ ๐ โproxy - Returns whether
obj
is a DOM object implemented as a proxy. - jsid_
to_ ๐ โstring - Convert
id
to aDOMString
. ReturnsNone
ifid
is not a string or integer. - native_
from_ ๐handlevalue - Get a
*const T
for a DOM object accessible from aHandleValue
. Caller is responsible for throwing a JS exception if needed in case of error. - native_
from_ ๐ โobject - Get a
*const T
for a DOM object accessible from aJSObject
. - native_
from_ ๐ โobject_ static - Get a
*const T
for a DOM object accessible from aJSObject
, where the DOM object is guaranteed not to be a wrapper. - private_
from_ ๐ โobject - Get the private pointer of a DOM object from a given reflector.
- private_
from_ ๐ โproto_ check - Get a
*const libc::c_void
for the given DOM object, unwrapping any wrapper around it first, and checking if the object is of the correct type. - root_
from_ ๐handleobject - Get a
DomRoot<T>
for a DOM object accessible from aHandleObject
. - root_
from_ ๐handlevalue - Get a
DomRoot<T>
for a DOM object accessible from aHandleValue
. Caller is responsible for throwing a JS exception if needed in case of error. - root_
from_ ๐ โobject - Get a
DomRoot<T>
for the given DOM object, unwrapping any wrapper around it first, and checking if the object is of the correct type. - root_
from_ ๐object_ static - Get a
DomRoot<T>
for the given DOM object, unwrapping any wrapper around it first, and checking if the object is of the correct type.