]> git.proxmox.com Git - rustc.git/blob - library/std/src/sys/wasm/mod.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / library / std / src / sys / wasm / mod.rs
1 //! System bindings for the wasm/web platform
2 //!
3 //! This module contains the facade (aka platform-specific) implementations of
4 //! OS level functionality for wasm. Note that this wasm is *not* the emscripten
5 //! wasm, so we have no runtime here.
6 //!
7 //! This is all super highly experimental and not actually intended for
8 //! wide/production use yet, it's still all in the experimental category. This
9 //! will likely change over time.
10 //!
11 //! Currently all functions here are basically stubs that immediately return
12 //! errors. The hope is that with a portability lint we can turn actually just
13 //! remove all this and just omit parts of the standard library if we're
14 //! compiling for wasm. That way it's a compile time error for something that's
15 //! guaranteed to be a runtime error!
16
17 pub mod alloc;
18 pub mod args;
19 #[path = "../unsupported/cmath.rs"]
20 pub mod cmath;
21 pub mod env;
22 #[path = "../unsupported/fs.rs"]
23 pub mod fs;
24 #[path = "../unsupported/io.rs"]
25 pub mod io;
26 #[path = "../unsupported/net.rs"]
27 pub mod net;
28 #[path = "../unsupported/os.rs"]
29 pub mod os;
30 #[path = "../unix/path.rs"]
31 pub mod path;
32 #[path = "../unsupported/pipe.rs"]
33 pub mod pipe;
34 #[path = "../unsupported/process.rs"]
35 pub mod process;
36 #[path = "../unsupported/stack_overflow.rs"]
37 pub mod stack_overflow;
38 #[path = "../unsupported/stdio.rs"]
39 pub mod stdio;
40 pub mod thread;
41 #[path = "../unsupported/thread_local_dtor.rs"]
42 pub mod thread_local_dtor;
43 #[path = "../unsupported/thread_local_key.rs"]
44 pub mod thread_local_key;
45 #[path = "../unsupported/time.rs"]
46 pub mod time;
47
48 pub use crate::sys_common::os_str_bytes as os_str;
49
50 cfg_if::cfg_if! {
51 if #[cfg(target_feature = "atomics")] {
52 #[path = "condvar_atomics.rs"]
53 pub mod condvar;
54 #[path = "mutex_atomics.rs"]
55 pub mod mutex;
56 #[path = "rwlock_atomics.rs"]
57 pub mod rwlock;
58 } else {
59 #[path = "../unsupported/condvar.rs"]
60 pub mod condvar;
61 #[path = "../unsupported/mutex.rs"]
62 pub mod mutex;
63 #[path = "../unsupported/rwlock.rs"]
64 pub mod rwlock;
65 }
66 }
67
68 #[path = "../unsupported/common.rs"]
69 mod common;
70 pub use common::*;