Skip to main content

Crate comlink_sys

Crate comlink_sys 

Source
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§

CREATE_ENDPOINT
FINALIZER
PROXY_MARKER
RELEASE_PROXY
TRANSFER_HANDLERS

Functions§

expose
Serves calls on the global scope, dispatching them onto obj.
expose_with_endpoint
Serves calls on endpoint, dispatching them onto obj.
expose_with_endpoint_and_allowed_origins
Serves calls on endpoint, ignoring messages whose origin matches none of allowed_origins (an array of strings and regular expressions).
proxy
Marks obj to cross as a MessagePort-backed proxy rather than being structurally cloned.
transfer
Marks transfers as the transferables of the next post of value, and returns value unchanged.
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 context and posting with target_origin.
wrap
Returns the object exposed on endpoint as a JavaScript Proxy.
wrap_with_target
Returns a proxy for endpoint whose calls are applied to target.