Skip to main content

partitions/
lib.rs

1//! Partition-table probe (GPT/MBR) and filesystem-magic sniffer over any
2//! random-access block source.
3//!
4//! See the crate-level [`README`](https://github.com/antimatter-studios/rust-partitions)
5//! for design and scope.
6//!
7//! Block-device abstractions come from
8//! [`fs_core`](https://github.com/antimatter-studios/rust-fs-core); this
9//! crate re-exports the bits most consumers will use so callers can `use
10//! partitions::BlockRead;` without an extra dependency line.
11
12#![deny(unsafe_op_in_unsafe_fn)]
13
14pub mod capi;
15pub mod error;
16pub mod gpt;
17pub mod gpt_write;
18pub mod mbr;
19pub mod mutation;
20pub mod probe;
21pub mod sniff;
22
23pub use error::{Error, Result};
24pub use mutation::{PartitionRef, PartitionSet, PartitionTypeId};
25pub use probe::{probe, Partition, PartitionKind, TableKind};
26pub use sniff::{sniff, FsKind};
27
28// Re-export the core block-device pieces so consumers don't have to depend
29// on fs-core directly for the common cases. SliceReader / OwnedSlice
30// originally lived here but moved to fs-core in v0.2 — they're generic
31// block-layer types, not partition-specific. Re-exported to keep
32// existing `partitions::SliceReader` callers working.
33pub use fs_core::{BlockDevice, BlockRead, FileDevice as FileBlock, OwnedSlice, SliceReader};