ab_core_primitives/
lib.rs

1//! Core primitives for the protocol
2
3#![cfg_attr(any(target_os = "none", target_os = "unknown"), no_std)]
4#![warn(rust_2018_idioms, missing_debug_implementations, missing_docs)]
5#![feature(
6    const_cmp,
7    const_convert,
8    const_trait_impl,
9    const_try,
10    portable_simd,
11    ptr_as_ref_unchecked,
12    step_trait,
13    trusted_len
14)]
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/141492
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 ed25519;
26pub mod hashes;
27mod nano_u256;
28pub mod pieces;
29pub mod pos;
30pub mod pot;
31pub mod sectors;
32pub mod segments;
33pub mod shard;
34pub mod solutions;
35pub mod transaction;
36
37#[cfg(feature = "alloc")]
38extern crate alloc;
39
40const _: () = {
41    assert!(
42        size_of::<usize>() >= size_of::<u32>(),
43        "Must be at least 32-bit platform"
44    );
45};