Cargo Features

[dependencies]
virtual-fs = { version = "0.702.0-alpha.1", default-features = false, features = ["host-fs", "webc-fs", "static-fs", "enable-serde", "js", "tracking", "futures"] }
default = host-fs, static-fs, webc-fs

These default features are set whenever virtual-fs is added without default-features = false somewhere in the dependency tree.

host-fs default = filetime, fs_extra, libc

Enables fs, io-std and rt of tokio

Affects virtual-fs::host_fs

webc-fs default = anyhow, webc
static-fs default = anyhow, webc

Affects virtual-fs::static_fs

enable-serde = serde, typetag
js

Enables web-time and wasm_js of getrandom

getrandom:

Optional backend: wasm_js

This flag enables the wasm_js backend and uses it by default on wasm32 where the target_os is unknown. The getrandom_backend cfg may override this.

WARNING: We strongly recommend against enabling this feature in libraries (except for tests) since it is known to break non-Web WASM builds and further since the usage of wasm-bindgen causes significant bloat to Cargo.lock (on all targets).

The only exception to this rule: if your crate already unconditionally depends on wasm-bindgen or js-sys on "unknown" WASM targets then it's acceptable to enable this feature unconditionally.

tracking

Enables memory tracking/limiting functionality for the in-memory filesystem.

futures

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

anyhow static-fs webc-fs
filetime host-fs
fs_extra host-fs
libc host-fs
typetag enable-serde?
webc static-fs webc-fs
serde enable-serde?