nakamoto_common/lib.rs
1//! Library of common Bitcoin functionality shared by all crates.
2#![allow(clippy::type_complexity)]
3#![deny(missing_docs, unsafe_code)]
4pub mod block;
5pub mod collections;
6pub mod network;
7pub mod p2p;
8
9pub use bitcoin;
10pub use bitcoin_hashes;
11pub use nakamoto_net as net;
12pub use nonempty;
13
14/// Return the function path at the current source location.
15#[macro_export]
16macro_rules! source {
17 () => {{
18 fn f() {}
19 fn type_of<T>(_: T) -> &'static str {
20 std::any::type_name::<T>()
21 }
22 let name = type_of(f);
23 &name[..name.len() - 3]
24 }};
25}