WsNativeLibrary class final

The Rust library (libws_native), loaded and checked.

Get one with open (a file path; for executables built with dart compile exe, see dart run ws:install) or let ws_native provide the copy its build hook bundles. Then install it.

The functions are looked up and wrapped once per library; calls go straight through function pointers (DECISIONS.md D30).

Constructors

WsNativeLibrary.fromSymbols(NativeSymbols symbols)
Wraps symbols resolved by someone else (ws_native takes them from its bundled code asset). Throws UnsupportedError if the library speaks a different ABI version.
factory
WsNativeLibrary.open(String path)
Loads the library from path and checks it.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

install({int threads = 2, int window = 8 << 20}) → bool
Starts the library's runtime (threads worker threads; only the first call per loaded library has an effect) and makes its transport the default for clients created afterwards. Returns false and changes nothing if the runtime could not start.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited
transport({int window = 8 << 20}) → NativeTransport
A transport on this library, for WebSocketOptions.transport. install must have been called once.

Operators

operator ==(Object other) → bool
The equality operator.
inherited