Movatterモバイル変換


[0]ホーム

URL:


Docs.rs

Module interop

Moduleinterop 

Source
Expand description

Interop module containing traits and types to ease integration between Boaand Rust.

Structs§

ContextData
Captures aContextData data from theContext as a JS function argument,based on its type.
Ignore
An argument that would be ignored in a JS function. This is equivalent of typing() in Rust functions argument, but more explicit.
JsAll
An argument that when used in a JS function will capture allthe arguments that can be converted toT. The first argumentthat cannot be converted toT will stop the conversion.
JsClass
Captures a class instance from thethis value in a JS function. The classwill be a non-mutable reference of Rust typeT, if it is an instance ofT.
JsRest
An argument that when used in a JS function will empty the listof JS arguments asJsValues. This can be used for having therest of the arguments in a function. It should be the lastargument of your function, before theContext argument if any.
JsThis
Captures thethis value in a JS function. Although this can bespecified multiple times as argument, it will always be filledwith clone of the same value.

Traits§

IntoJsFunctionCopied
The safe equivalent of theUnsafeIntoJsFunction trait.This can only be used on closures that have theCopy trait.
TryFromJsArgument
Create a Rust value from a JS argument. This trait is used toconvert arguments from JS to Rust types. It allows supportfor optional arguments or rest arguments.
UnsafeIntoJsFunction
A trait to convert a type into a JS function.This trait does not require the implementing type to beCopy, whichcan lead to undefined behaviour if it contains Garbage Collected objects.

[8]ページ先頭

©2009-2025 Movatter.jp