-
Notifications
You must be signed in to change notification settings - Fork 1
/
lib.rs
73 lines (63 loc) · 1.49 KB
/
lib.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! Tricky Pipe
//!
//! Tricky Pipe is a channel that has interchangeable ends to allow for
//! transparent serialization and deserialization.
//!
//! It is intended to be used in cases where you *sometimes* need to traverse
//! a network hop (or similar), and Serialization or Deserialization may occur.
#![cfg_attr(not(test), no_std)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![warn(rustdoc::broken_intra_doc_links)]
#![warn(missing_docs)]
#[cfg(any(feature = "alloc", test, loom))]
extern crate alloc;
#[cfg(not(test))]
macro_rules! test_dbg {
($x:expr) => {
$x
};
}
#[cfg(test)]
macro_rules! test_dbg {
($x:expr) => {
match $x {
x => {
const EXPR: &str = stringify!($x);
tracing::event!(tracing::Level::DEBUG, { EXPR } = ?format_args!("{x:#?}"));
x
}
}
};
}
#[cfg(not(test))]
macro_rules! test_println {
($($arg:tt)*) => {};
}
#[cfg(test)]
macro_rules! test_println {
($($arg:tt)*) => {
tracing::info!($($arg)*);
};
}
#[cfg(not(test))]
macro_rules! test_span {
($($arg:tt)*) => {};
}
#[cfg(all(test, not(loom)))]
macro_rules! test_span {
($($arg:tt)*) => {
let _span = tracing::debug_span!($($arg)*).entered();
};
}
#[cfg(all(test, loom))]
macro_rules! test_span {
($($arg:tt)*) => {
tracing::info!(message = $($arg)*);
};
}
pub mod bidi;
pub(crate) mod loom;
pub mod mpsc;
pub mod oneshot;
pub mod serbox;
pub(crate) mod typeinfo;