Module mozjs::rust[][src]

Rust wrappers around the raw JS apis

Modules

jsapi_wrapped

Wrappers for JSAPI methods that accept lifetimed Handle and MutableHandle arguments.

wrappers

Wrappers for JSAPI methods that should NOT be used.

Structs

CapturedJSStack
CompileOptionsWrapper
CustomAutoRooter
CustomAutoRooterGuard

An RAII guard used to root underlying data in CustomAutoRooter until the guard is dropped (falls out of scope). The underlying data can be accessed through this guard via its Deref and DerefMut implementations. This structure is created by root method on CustomAutoRooter or by the auto_root! macro.

ENGINE_STATE
Handle
IdVector
JSEngine

A handle that must be kept alive in order to create new Runtimes. When this handle is dropped, the engine is shut down and cannot be reinitialized.

JSEngineHandle
MutableHandle
ParentRuntime

A handle to a Runtime that will be used to create a new runtime in another thread. This handle and the new runtime must be destroyed before the original runtime can be dropped.

RealmOptions
RootedGuard

Rust API for keeping a Rooted value in the context’s root stack. Example usage: rooted!(in(cx) let x = UndefinedValue());. RootedGuard::new also works, but the macro is preferred.

RootedObjectVectorWrapper
Runtime

A wrapper for the JSContext structure in SpiderMonkey.

ScriptedCaller

Enums

EngineState
JSEngineError

Constants

CONTEXT
ChunkShift
ChunkSize
ConstNullValue
STACK_QUOTA
SYSTEM_CODE_BUFFER
TRUSTED_SCRIPT_BUFFER

Statics

SIMPLE_GLOBAL_CLASS

This is a simple JSClass for global objects, primarily intended for tests.

SIMPLE_GLOBAL_CLASS_OPS

Traits

CustomAutoTraceable

CustomAutoRooter uses dynamic dispatch on the C++ side for custom tracing, so provide trace logic via vftable when creating an object on Rust side.

CustomTrace

Similarly to Trace trait, it’s used to specify tracing of various types that are used in conjunction with CustomAutoRooter.

GCMethods

A trait for types which can place appropriate GC barriers.

IntoHandle

Trait for things that can be converted to handles For any type T: IntoHandle we have an implementation of From<T> for MutableHandle<T::Target>. This is a way round the orphan rule.

IntoMutableHandle
ToResult
Trace

Types that can be traced.

Functions

ToBoolean
ToInt32
ToInt64
ToNumber
ToString
ToUint16
ToUint32
ToUint64
ToWindowProxyIfWindow
convert_from_int32
define_methods

Defines methods on obj. The last entry of methods must contain zeroed memory.

define_properties

Defines attributes on obj. The last entry of properties must contain zeroed memory.

describe_scripted_caller
get_context_realm
get_object_class
get_object_group
get_object_realm
is_dom_class
is_dom_object
is_window
maybe_wrap_object_or_null_value
maybe_wrap_object_value
maybe_wrap_value
report_warning
transform_str_to_source_text
transform_u16_to_source_text
try_to_outerize

Type Definitions

HandleFunction
HandleId
HandleObject
HandleScript
HandleString
HandleSymbol
HandleValue
MutableHandleFunction
MutableHandleId
MutableHandleObject
MutableHandleScript
MutableHandleString
MutableHandleSymbol
MutableHandleValue
SequenceRooter
SequenceRooterGuard