bee_block/lib.rs
1// Copyright 2020-2021 IOTA Stiftung
2// SPDX-License-Identifier: Apache-2.0
3
4//! Core data types for blocks in the tangle.
5
6#![cfg_attr(not(feature = "std"), no_std)]
7#![cfg_attr(doc_cfg, feature(doc_cfg))]
8#![deny(missing_docs, warnings)]
9
10extern crate alloc;
11#[cfg(feature = "std")]
12extern crate std;
13
14#[macro_use]
15mod r#macro;
16mod block_id;
17mod error;
18
19/// A module that provides DTOs.
20#[cfg(feature = "dto")]
21pub mod dto;
22
23/// A module that provides types and syntactic validations of addresses.
24pub mod address;
25/// A module that provides types and syntactic validations of blocks.
26pub mod block;
27/// A module that contains helper functions and types.
28pub mod helper;
29/// A module that provides types and syntactic validations of inputs.
30pub mod input;
31/// A module that provides types and syntactic validations of outputs.
32pub mod output;
33/// A module that provides types and syntactic validations of parents.
34pub mod parent;
35/// A module that provides types and syntactic validations of payloads.
36pub mod payload;
37/// A module that provides types and syntactic validations of protocol parameters.
38pub mod protocol;
39/// A module that provides utilities for random generation of types.
40#[cfg(feature = "rand")]
41pub mod rand;
42/// A module that provides types and rules for semantic validation.
43pub mod semantic;
44/// A module that provides types and syntactic validations of signatures.
45pub mod signature;
46/// A module that provides types and syntactic validations of unlocks.
47pub mod unlock;
48
49#[cfg(feature = "inx")]
50pub use self::error::inx::InxError;
51#[cfg(feature = "dto")]
52pub use self::{block::dto::BlockDto, error::dto::DtoError};
53pub use self::{
54 block::{Block, BlockBuilder},
55 block_id::BlockId,
56 error::Error,
57};
58
59pub(crate) const PROTOCOL_VERSION: u8 = 2;