Supported crates
Learn about popular Rust crates which have been confirmed to work on Workers when using workers-rs โ (or in some cases just wasm-bindgen), to write Workers in WebAssembly.
Each Rust crate example includes any custom configuration that is required.
This is not an exhaustive list, many Rust crates can be compiled to the wasm32-unknown-unknown โ target that is supported by Workers.
In some cases, this may require disabling default features or enabling a Wasm-specific feature. It is important to consider the addition of new dependencies, as this can significantly increase the size of your Worker.
Many crates which have been made Wasm-friendly, will use the time crate instead of std::time. For the time crate to work in Wasm, the wasm-bindgen feature must be enabled to obtain timing information from JavaScript.
Tracing can be enabled by using the tracing-web crate and the time feature for tracing-subscriber.
Due to timing limitations on Workers, spans will have identical start and end times unless they encompass I/O.
Refer to the tracing example โ for more information.
The reqwest library โ can be compiled to Wasm, and hooks into the JavaScript fetch API automatically using wasm-bindgen.
tokio-postgres can be compiled to Wasm. It must be configured to use a Socket from workers-rs:
Refer to the tokio-postgres example โ for more information.
The hyper crate contains two HTTP clients, the lower-level conn module and the higher-level Client.
The conn module can be used with Workers Socket, however Client requires timing dependencies which are
not yet Wasm friendly.
Refer to the hyper example โ for more information.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark