Closed aran closed 3 days ago
Firstly, I wonder why do you want to disable those features? IIRC Rust does a lot of optimizations and will eliminate dead code if you do not use a feature automatically.
Secondly, for thread pools: https://github.com/fzyzcjy/flutter_rust_bridge/issues/2215 may be related if you want to disable it because of the web things.
My thinking was, I'm not (supposed to be) using them. If I were to use the threadpool accidentally, that would be a bug. I do see some extra activity in web console in setting up the service workers which I assume is due to the threadpool.
For async, just looking for opportunities to cut down surface area.
I see, then #2215 may be useful for thread pool thing. For async, looks like e.g. opaque types uses tokio rwlock currently, so it requires the tokio dependency, and thus the flag async.
Close since that issue is closed. But feel free to reopen this issue if you have any questions!
Is your feature request related to a problem? Please describe. From website/docs/guides/custom/rust/feature-flags.md it may be possible to remove unused features from the FRB import.
In my project at least, in disabling
threadpool
, the default generated executor seems to break compilation:In disabling
rust-async
—I am trying to use all methods as#[frb(sync)]
, but it's possible I've missed something—I see errors due toLockable
,RustAutoOpaqueInner
,LockableOrderInfo
and a few others. The RustAutoOpaqueInner errors are tied to types that I havepub use
imported,frb(mirror(
, and#[frb(external)]
. E.g.:Describe the solution you'd like Not sure. I am already using, or intending to use, all sync methods for thread safety on wasm platform. I don't think I am using the threadpools. I would be looking for either documentation, example code, or code-generator errors to lead me to what I've done wrong here.
Describe alternatives you've considered N/A