ext4_mkfs/lib.rs
1//! High-level Rust API for creating ext4 filesystems.
2//!
3//! This crate provides a safe Rust interface for formatting storage devices
4//! as ext4 filesystems using the lwext4 library.
5//!
6//! # Example
7//!
8//! ```no_run
9//! use ext4_mkfs::{mkfs, MkfsConfig, IoBlockDevice, FsType};
10//! use std::fs::OpenOptions;
11//!
12//! // Open a file as a block device
13//! let file = OpenOptions::new()
14//! .read(true)
15//! .write(true)
16//! .open("disk.img")
17//! .unwrap();
18//!
19//! // Create a block device wrapper (512-byte sectors, 100MB total)
20//! let device = IoBlockDevice::new(file, 512, 100 * 1024 * 1024);
21//!
22//! // Format as ext4
23//! let config = MkfsConfig::new()
24//! .fs_type(FsType::Ext4)
25//! .block_size(4096)
26//! .label("my_volume");
27//!
28//! mkfs(device, config).unwrap();
29//! ```
30
31pub mod block_device;
32pub mod error;
33pub mod mkfs;
34
35pub use block_device::{BlockDevice, IoBlockDevice};
36pub use error::{Error, Result};
37pub use mkfs::{mkfs, FsType, MkfsConfig};