1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//! # Hadris Common
//!
//! Shared types and utilities used across the Hadris filesystem crates.
//!
//! This crate provides foundational types for working with on-disk filesystem
//! structures, including endian-aware integers, extents, fixed-length filenames,
//! path manipulation, and optical media constants.
//!
//! ## Feature Flags
//!
//! | Feature | Default | Description |
//! |------------|---------|-------------|
//! | `std` | yes | Standard library support (CRC, chrono, rand) |
//! | `alloc` | via std | Heap allocation (`String`, `Vec` types) |
//! | `bytemuck` | yes | Zero-copy serialization for number types |
//! | `optical` | no | Optical media types for CD/DVD/Blu-ray |
//! | `sync` | via std | Synchronous I/O (forwarded to `hadris-io`) |
//! | `async` | no | Asynchronous I/O (forwarded to `hadris-io`) |
//!
//! ## Key Types
//!
//! - **Endian numbers**: [`types::number::U16`], [`types::number::U32`],
//! [`types::number::U64`] — unsigned integers parameterized by endianness.
//! - **Extent**: [`types::extent::Extent`] — a contiguous region on disk
//! (sector + length).
//! - **FixedFilename**: [`types::file::FixedFilename`] — a stack-allocated
//! filename with a compile-time maximum length.
//! - **EndianType / Endianness**: [`types::endian::EndianType`],
//! [`types::endian::Endianness`] — runtime and compile-time endianness.
//!
//! ## Example
//!
//! ```rust
//! use hadris_common::types::endian::{Endian, LittleEndian};
//! use hadris_common::types::number::U32;
//!
//! let value = U32::<LittleEndian>::new(0x12345678);
//! assert_eq!(value.get(), 0x12345678);
//! ```
extern crate alloc;
extern crate std;
/// Algorithms (requires std for CRC and random)
/// Path utilities
/// Strings (requires alloc for String/Vec)
/// Types
/// Optical media types (requires `optical` feature)
/// A generic 512-byte boot sector binary.
///
/// When written to the start of a disk image, this boot sector displays a
/// message informing the user that the image is not directly bootable.
///
/// ```rust
/// assert_eq!(hadris_common::BOOT_SECTOR_BIN.len(), 512);
/// // Boot sector signature at end
/// assert_eq!(hadris_common::BOOT_SECTOR_BIN[510], 0x55);
/// assert_eq!(hadris_common::BOOT_SECTOR_BIN[511], 0xAA);
/// ```
pub static BOOT_SECTOR_BIN: & = include_bytes!;