Skip to content

Commit

Permalink
Document the web feature in lib.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
DanGould committed Feb 15, 2024
1 parent 5e3171f commit f0ec11b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@
//! [`Rc`]: https://doc.rust-lang.org/std/rc/struct.Rc.html
//! [`Arc`]: https://doc.rust-lang.org/std/sync/struct.Arc.html
//! [`PrivateKeyDer::clone_key()`]: https://docs.rs/rustls-pki-types/latest/rustls_pki_types/enum.PrivateKeyDer.html#method.clone_key
//!
//! ## Target `wasm32-unknown-unknown` with the `web` feature
//!
//! [`std::time::SystemTime`](https://doc.rust-lang.org/std/time/struct.SystemTime.html)
//! is unavailable in `wasm32-unknown-unknown` targets, so calls to
//! [`UnixTime::now()`](https://docs.rs/rustls-pki-types/latest/rustls_pki_types/struct.UnixTime.html#method.now),
//! otherwise enabled by the [`std`](https://docs.rs/crate/rustls-pki-types/latest/features#std) feature,
//! require building instead with the [`web`](https://docs.rs/crate/rustls-pki-types/latest/features#web)
//! feature. It gets time by calling [`Performance.now()`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now).
//! in the browser. According to the underlying [`web-time`](https://github.com/daxpedda/web-time)
//! dependency on which the feature is built, "Emscripten is not supported. WASI doesn't require
//! support as it has it's own native API to deal with std::time."
#![cfg_attr(not(feature = "std"), no_std)]
#![warn(unreachable_pub, clippy::use_self)]
Expand Down

0 comments on commit f0ec11b

Please sign in to comment.