ab_core_primitives/
lib.rs

1//! Core primitives for the protocol
2
3#![no_std]
4#![warn(rust_2018_idioms, missing_debug_implementations, missing_docs)]
5#![feature(
6    array_chunks,
7    const_trait_impl,
8    const_try,
9    generic_arg_infer,
10    portable_simd,
11    ptr_as_ref_unchecked,
12    step_trait
13)]
14#![cfg_attr(feature = "alloc", feature(new_zeroed_alloc))]
15#![expect(incomplete_features, reason = "generic_const_exprs")]
16// TODO: This feature is not actually used in this crate, but is added as a workaround for
17//  https://github.com/rust-lang/rust/issues/133199
18#![feature(generic_const_exprs)]
19
20pub mod address;
21pub mod balance;
22pub mod block;
23#[cfg(feature = "scale-codec")]
24pub mod checksum;
25pub mod hashes;
26pub mod pieces;
27pub mod pos;
28pub mod pot;
29pub mod sectors;
30pub mod segments;
31pub mod shard;
32pub mod solutions;
33pub mod transaction;
34
35#[cfg(feature = "alloc")]
36extern crate alloc;
37
38const _: () = {
39    assert!(
40        size_of::<usize>() >= size_of::<u32>(),
41        "Must be at least 32-bit platform"
42    );
43};