1use core::fmt;
4
5mod wake;
6pub use self::wake::{UnsafeWake, Waker};
7
8mod context;
9pub use self::context::Context;
10
11if_std! {
12 pub use self::wake::Wake;
13
14 mod data;
15 pub use self::data::LocalKey;
16}
17
18#[cfg(not(feature = "std"))]
19mod data {
20 pub struct LocalMap;
21
22 pub fn local_map() -> LocalMap {
23 LocalMap
24 }
25}
26
27
28#[cfg_attr(feature = "nightly", cfg(target_has_atomic = "ptr"))]
29mod atomic_waker;
30#[cfg_attr(feature = "nightly", cfg(target_has_atomic = "ptr"))]
31pub use self::atomic_waker::AtomicWaker;
32
33pub struct LocalMap {
35 #[allow(dead_code)]
36 inner: data::LocalMap,
37}
38
39impl LocalMap {
40 pub fn new() -> LocalMap {
42 LocalMap { inner: data::local_map() }
43 }
44}
45
46impl fmt::Debug for LocalMap {
47 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
48 f.debug_struct("LocalMap")
49 .finish()
50 }
51}