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

103 lines
3.4 KiB
Rust
Raw Normal View History

2014-07-18 13:56:17 +00:00
// Rust Bitcoin Library
// Written in 2014 by
// Andrew Poelstra <apoelstra@wpsoftware.net>
//
// To the extent possible under law, the author(s) have dedicated all
// copyright and related and neighboring rights to this software to
// the public domain worldwide. This software is distributed without
// any warranty.
//
// You should have received a copy of the CC0 Public Domain Dedication
// along with this software.
// If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
//
//! # Rust Bitcoin Library
//!
//! This is a library for which supports the Bitcoin network protocol and associated
//! primitives. It is designed for Rust programs built to work with the Bitcoin
//! network.
//!
//! It is also written entirely in Rust to illustrate the benefits of strong type
//! safety, including ownership and lifetime, for financial and/or cryptographic
//! software.
//!
#![crate_name = "bitcoin"]
#![crate_type = "dylib"]
#![crate_type = "rlib"]
// Experimental features we need
2015-09-20 17:22:39 +00:00
#![cfg_attr(all(test, feature = "unstable"), feature(test))]
2014-07-18 13:56:17 +00:00
2016-06-21 14:35:27 +00:00
// Clippy whitelist
#![cfg_attr(feature = "clippy", allow(needless_range_loop))] // suggests making a big mess of array newtypes
#![cfg_attr(feature = "clippy", allow(extend_from_slice))] // `extend_from_slice` only available since 1.6
2014-07-18 13:56:17 +00:00
// Coding conventions
2019-02-20 22:16:21 +00:00
#![forbid(unsafe_code)]
#![deny(non_upper_case_globals)]
2014-07-18 13:56:17 +00:00
#![deny(non_camel_case_types)]
2014-08-30 23:08:38 +00:00
#![deny(non_snake_case)]
2014-07-18 13:56:17 +00:00
#![deny(unused_mut)]
#![deny(dead_code)]
#![deny(unused_imports)]
#![deny(missing_docs)]
2019-07-23 21:29:45 +00:00
#![forbid(unsafe_code)]
2019-10-28 19:17:53 +00:00
// In general, rust is absolutely horrid at supporting users doing things like,
// for example, compiling Rust code for real environments. Disable useless lints
// that don't do anything but annoy us and cant actually ever be resolved.
#![allow(bare_trait_objects)]
#![allow(ellipsis_inclusive_range_patterns)]
2014-07-18 13:56:17 +00:00
// Re-exported dependencies.
#[macro_use] pub extern crate bitcoin_hashes as hashes;
pub extern crate secp256k1;
pub extern crate bech32;
#[cfg(feature = "serde")] extern crate serde;
2018-11-10 00:45:00 +00:00
#[cfg(all(test, feature = "serde"))] #[macro_use] extern crate serde_derive; // for 1.22.0 compat
#[cfg(all(test, feature = "serde"))] extern crate serde_json;
#[cfg(all(test, feature = "serde"))] extern crate serde_test;
2015-09-20 17:22:39 +00:00
#[cfg(all(test, feature = "unstable"))] extern crate test;
2018-03-10 14:35:49 +00:00
#[cfg(feature="bitcoinconsensus")] extern crate bitcoinconsensus;
2014-07-18 13:56:17 +00:00
#[cfg(target_pointer_width = "16")]
compile_error!("rust-bitcoin cannot be used on 16-bit architectures");
2015-04-10 23:15:57 +00:00
#[cfg(test)]
#[macro_use]
mod test_macros;
#[macro_use]
2014-07-18 13:56:17 +00:00
mod internal_macros;
#[macro_use]
2014-07-18 13:56:17 +00:00
pub mod network;
pub mod blockdata;
pub mod util;
pub mod consensus;
// Do not remove: required in order to get hash types implementation macros to work correctly
#[allow(unused_imports)]
pub mod hash_types;
pub use hash_types::*;
pub use blockdata::block::Block;
pub use blockdata::block::BlockHeader;
pub use blockdata::script::Script;
pub use blockdata::transaction::Transaction;
pub use blockdata::transaction::TxIn;
pub use blockdata::transaction::TxOut;
pub use blockdata::transaction::OutPoint;
pub use blockdata::transaction::SigHashType;
pub use consensus::encode::VarInt;
2018-10-21 22:28:27 +00:00
pub use network::constants::Network;
pub use util::Error;
pub use util::address::Address;
2019-07-16 20:31:49 +00:00
pub use util::address::AddressType;
2018-11-10 00:45:00 +00:00
pub use util::amount::Amount;
pub use util::amount::Denomination;
2018-11-10 00:45:00 +00:00
pub use util::amount::SignedAmount;
pub use util::key::PrivateKey;
pub use util::key::PublicKey;
pub use util::merkleblock::MerkleBlock;