rust-bitcoin-unsafe-fast/primitives/src/lib.rs

52 lines
1.4 KiB
Rust

// SPDX-License-Identifier: CC0-1.0
//! # Rust Bitcoin - primitive types.
//!
//! Primitive data types that are used throughout the [`rust-bitcoin`] ecosystem.
//!
//! This crate can be used in a no-std environment but requires an allocator.
//!
//! [`rust-bitcoin`]: <https://github.com/rust-bitcoin>
#![cfg_attr(all(not(test), not(feature = "std")), no_std)]
// Experimental features we need.
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
// Coding conventions.
#![warn(missing_docs)]
// Exclude lints we don't think are valuable.
#![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134
#![allow(clippy::manual_range_contains)] // More readable than clippy's format.
#![allow(clippy::needless_borrows_for_generic_args)] // https://github.com/rust-lang/rust-clippy/issues/12454
#[cfg(feature = "alloc")]
extern crate alloc;
#[cfg(feature = "std")]
extern crate std;
#[cfg(feature = "serde")]
#[macro_use]
extern crate serde;
#[cfg(feature = "alloc")]
pub mod locktime;
pub mod opcodes;
pub mod pow;
pub mod sequence;
#[doc(inline)]
pub use units::*;
#[doc(inline)]
#[cfg(feature = "alloc")]
pub use self::locktime::{absolute, relative};
#[doc(inline)]
pub use self::{pow::CompactTarget, sequence::Sequence};
#[rustfmt::skip]
#[allow(unused_imports)]
mod prelude {
#[cfg(feature = "alloc")]
pub use alloc::string::{String, ToString};
}