Module utils

Source

StructsΒ§

DOMClass
The struct that holds inheritance information for DOM object reflectors.
DOMJSClass
The JSClass used for DOM object reflectors.

ConstantsΒ§

DOM_PROTOTYPE_SLOT πŸ”’
The index of the slot that contains a reference to the ProtoOrIfaceArray.
DOM_PROTO_UNFORGEABLE_HOLDER_SLOT πŸ”’
The index of the slot where the object holder of that interface’s unforgeable members are defined.
JSCLASS_DOM_GLOBAL πŸ”’
The flag set on the JSClasses for DOM global objects.

TraitsΒ§

AsCCharPtrPtr πŸ”’
AsVoidPtr

FunctionsΒ§

call_setter πŸ”’ ⚠
delete_property_by_id πŸ”’ ⚠
Deletes the property id from object.
enumerate_global πŸ”’ ⚠
Enumerate lazy properties of a global object. Modeled after https://github.com/mozilla/gecko-dev/blob/3fd619f47/dom/bindings/BindingUtils.cpp#L2814
enumerate_window πŸ”’ ⚠
Enumerate lazy properties of a global object that is a Window. https://github.com/mozilla/gecko-dev/blob/3fd619f47/dom/base/nsGlobalWindowInner.cpp#3297
exception_to_promise πŸ”’ ⚠
Coverts exception to promise rejection
find_enum_value πŸ”’ ⚠
Find the enum equivelent of a string given by v in pairs. Returns Err(()) on JSAPI failure (there is a pending exception), and Ok((None, value)) if there was no matching string.
generic_call πŸ”’ ⚠
generic_getter πŸ”’ ⚠
Generic getter of IDL interface.
generic_lenient_getter πŸ”’ ⚠
Generic lenient getter of IDL interface.
generic_lenient_setter πŸ”’ ⚠
Generic lenient setter of IDL interface.
generic_method πŸ”’ ⚠
Generic method of IDL interface.
generic_setter πŸ”’ ⚠
Generic setter of IDL interface.
generic_static_promise_method πŸ”’ ⚠
https://searchfox.org/mozilla-central/rev/7279a1df13a819be254fd4649e07c4ff93e4bd45/dom/bindings/BindingUtils.cpp#3300
get_array_index_from_id
Get an array index from the given jsid. Returns None if the given jsid is not an integer.
get_dictionary_property⚠
Get the property with name property from object. Returns Err(()) on JSAPI failure (there is a pending exception), and Ok(false) if there was no property with the given name.
get_property_on_prototype πŸ”’ ⚠
Gets the property id on proxy’s prototype. If it exists, *found is set to true and *vp to the value, otherwise *found is set to false.
get_proto_or_iface_array πŸ”’ ⚠
Returns the ProtoOrIfaceArray for the given global object. Fails if global is not a DOM global object.
has_property_on_prototype⚠
Computes whether proxy has a property id on its prototype and stores the result in found.
latin1_bytes_from_id πŸ”’ ⚠
Returns a slice of bytes corresponding to the bytes in the provided string id. Returns an error if the id is not a string, or the string contains non-latin1 characters.
may_resolve_global πŸ”’ ⚠
Returns true if the resolve hook for this global may resolve the provided id. https://searchfox.org/mozilla-central/rev/f3c8c63a097b61bb1f01e13629b9514e09395947/dom/bindings/BindingUtils.cpp#2809 https://searchfox.org/mozilla-central/rev/f3c8c63a097b61bb1f01e13629b9514e09395947/js/public/Class.h#283-291
may_resolve_window πŸ”’ ⚠
Returns true if the resolve hook for this window may resolve the provided id. https://searchfox.org/mozilla-central/rev/f3c8c63a097b61bb1f01e13629b9514e09395947/dom/base/nsGlobalWindowInner.cpp#3275 https://searchfox.org/mozilla-central/rev/f3c8c63a097b61bb1f01e13629b9514e09395947/js/public/Class.h#283-291
resolve_global πŸ”’ ⚠
Resolve a lazy global property, for interface objects and named constructors.
resolve_window πŸ”’ ⚠
Resolve a lazy global property for a Window global.
set_dictionary_property⚠
Set the property with name property from object. Returns Err(()) on JSAPI failure, or null object, and Ok(()) otherwise
trace_global πŸ”’ ⚠
Trace the resources held by reserved slots of a global object

Type AliasesΒ§

ProtoOrIfaceArray
An array of *mut JSObject of size PROTO_OR_IFACE_LENGTH.