Expand description
Raw bindings to the Comlink
JavaScript library, covering its whole public surface and nothing more. The
ergonomic layer lives in the comlink crate.
Every item here is imported from the bare comlink module specifier, so the
npm package of that name has to be resolvable by whatever bundler or module
loader serves the generated JavaScript.
Comlink gives several parameters JavaScript default values, which
wasm_bindgen cannot express. Each of those is bound once per arity, named
after the parameters it passes, following the web-sys convention.
Statics§
Functions§
- expose
- Serves calls on the global scope, dispatching them onto
obj. - expose_
with_ endpoint - Serves calls on
endpoint, dispatching them ontoobj. - expose_
with_ endpoint_ and_ allowed_ origins - Serves calls on
endpoint, ignoring messages whose origin matches none ofallowed_origins(an array of strings and regular expressions). - proxy
- Marks
objto cross as aMessagePort-backed proxy rather than being structurally cloned. - transfer
- Marks
transfersas the transferables of the next post ofvalue, and returnsvalueunchanged. - window_
endpoint - Wraps a window-like object into an endpoint that posts to it and listens on the global scope.
- window_
endpoint_ with_ context - Wraps a window-like object into an endpoint listening on
context. - window_
endpoint_ with_ context_ and_ target_ origin - Wraps a window-like object into an endpoint listening on
contextand posting withtarget_origin. - wrap
- Returns the object exposed on
endpointas a JavaScriptProxy. - wrap_
with_ target - Returns a proxy for
endpointwhose calls are applied totarget.