You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `serde` feature flag was misleading: the serde crate is an
unconditional dependency, and the feature only gated the `iter_ext`
module (par_map/try_par_map). Rename it to `iter-ext` to accurately
reflect what it controls.
Also fix inaccurate doc comments on run_bytes/try_run_bytes that
referenced the non-existent serde feature gate.
Copy file name to clipboardExpand all lines: README.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,12 +32,10 @@ Enable the `macros` feature to get access to the `#[webworker_fn]` and `#[webwor
32
32
wasmworker = { version = "0.3", features = ["macros"] }
33
33
```
34
34
35
-
The `wasmworker` crate comes with a default feature called `serde`, which allows running any function on a web worker under the following two conditions:
36
-
1. The function takes a single argument, which implements `serde::Serialize + serde::Deserialize<'de>`.
37
-
2. The return type implements `serde::Serialize + serde::Deserialize<'de>`.
35
+
Function arguments and return types must implement `serde::Serialize + serde::Deserialize<'de>`.
36
+
Alternatively, functions with the type `fn(Box<[u8]>) -> Box<[u8]>` can be used via `run_bytes()` for manual serialization.
38
37
39
-
Without the `serde` feature, only functions with the type `fn(Box<[u8]>) -> Box<[u8]>` can be run on a worker.
40
-
This is useful for users that do not want a direct serde dependency. Internally, the library always uses serde, though.
38
+
The `iter-ext` feature (enabled by default) adds the `par_map` and `try_par_map` iterator extensions for convenient parallel map operations on the default worker pool.
41
39
42
40
#### Serialization codec
43
41
By default, `wasmworker` uses [postcard](https://crates.io/crates/postcard) for internal serialization.
@@ -48,7 +46,7 @@ Note that pot has significantly higher serialization overhead and larger output
48
46
49
47
```toml
50
48
[dependencies]
51
-
wasmworker = { version = "0.3", default-features = false, features = ["serde", "macros", "codec-pot"] }
49
+
wasmworker = { version = "0.3", default-features = false, features = ["iter-ext", "macros", "codec-pot"] }
52
50
```
53
51
54
52
You can then start using the library without further setup.
0 commit comments