pub struct Export {
pub comments: Vec<String>,
pub function: Function,
pub js_class: Option<String>,
pub js_namespace: Option<Vec<String>>,
pub method_kind: MethodKind,
pub method_self: Option<MethodSelf>,
pub rust_class: Option<Ident>,
pub rust_name: Ident,
pub start: StartKind,
pub wasm_bindgen: Path,
pub wasm_bindgen_futures: Path,
pub js_sys: Path,
}Expand description
A rust to js interface. Allows interaction with rust objects/functions from javascript.
Fields§
§comments: Vec<String>Comments extracted from the rust source.
function: FunctionThe rust function
js_class: Option<String>The class name in JS this is attached to
js_namespace: Option<Vec<String>>The namespace to export the item through, if any
method_kind: MethodKindThe kind (static, named, regular)
method_self: Option<MethodSelf>The type of self (either self, &self, or &mut self)
rust_class: Option<Ident>The struct name, in Rust, this is attached to
rust_name: IdentThe name of the rust function/method on the rust side.
start: StartKindWhether or not this function should be flagged as the Wasm start function.
wasm_bindgen: PathPath to wasm_bindgen
wasm_bindgen_futures: PathPath to wasm_bindgen_futures
js_sys: PathPath to js_sys
Implementations§
Source§impl Export
impl Export
Sourcepub fn rust_symbol(&self) -> Ident
pub fn rust_symbol(&self) -> Ident
Mangles a rust -> javascript export, so that the created Ident will be unique over function name and class name, if the function belongs to a javascript class.
Sourcepub fn export_name(&self) -> String
pub fn export_name(&self) -> String
This is the name of the shim function that gets exported and takes the raw ABI form of its arguments and converts them back into their normal, “high level” form before calling the actual function.