Expand description
libfw-client: reusable client-side transfer logic and browser glue.
The crate is intentionally split into a reusable Rust library core and a
thin wasm bridge. This allows the client logic to be consumed by Rust
code directly, while the JS/browser-facing API remains in the dedicated
WASM module.
§Two client forms, one protocol
- Native Rust (
native::NativeClient, any non-wasm32target): an asynctokio+reqwesttransport implementing the same wire protocol — resumableRangedownloads, the session upload protocol, zrip compression and the same adaptive tuning engine. Enable it by depending on this crate from a normal Rust binary/library. - Browser/WASM (
LibfwClient,wasm32only): the engine behind thesdk/npm package, which additionally supports the File System Access API and IndexedDB resume state. Its JavaScript API is documented insdk/README.mdandsdk/index.d.ts.
Modules§
- native
- Native (non-WASM) Rust client: async
reqwesttransport speaking the same wire protocol as the browser engine. Native (non-WASM) client: an async Rust transport for the libfw protocol.
Structs§
- Capabilities
- Full capability advertisement served at
GET /capabilities. - Client
Config - Runtime configuration of the WASM engine.
- File
Entry - A file to transfer, identified by its virtual path.
- IntRange
- Inclusive integer range with a server-chosen default.
- Limits
- Tuning-parameter ranges the server will tolerate.
- Tune
Event - A tuning event emitted when a window evaluation changed the state.
- Tune
Params - The shared, live parameter table.
- Tune
Stats - Smoothed transfer statistics.
- Zrip
Levels - Zrip (zstd) level range advertised by the server.
Enums§
- Compress
Level - Client-side compression level configuration.
- Compression
Format - Compression formats understood by libfw.
- Libfw
Error - Errors produced by the WASM engine.
- Transfer
Kind - Which transfer direction is ramping (drives which window/chunk dims move).
- Tune
Phase - Lifecycle of the tuning state machine.
Functions§
- backoff_
ms - Pure exponential backoff:
min(max, base << attempt)with saturation.
Type Aliases§
- Tune
Handle - Shared handle to the tuning engine (Rc so clones share one table).