Skip to main content

libblkid_rs/
lib.rs

1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5//! # `libblkid-rs`
6//!
7//! `libblkid_rs` provides programmatic access in Rust to the C library
8//! `libblkid`.
9//!
10//! ### Design
11//!
12//! The organization of the modules reflects the organization of the modules in the
13//! C library. The main goal of this library is to maintain the same general
14//! structure while taking advantage of Rust idioms.
15//!
16//! ### List of methods modified
17//! * `blkid_devno_to_wholedisk` - This bindings method handles the buffer internally
18//!   and therefore does not require a buffer argument. The limit for the maximum
19//!   size of the returned device name is 4096 bytes. Please open an issue if more
20//!   characters are required.
21//! * `blkid_get_dev_size` - This method takes a `&Path` in the bindings
22//!   and provides libblkid with the desired file descriptor.
23
24#![deny(missing_docs)]
25
26#[macro_use]
27mod macros;
28
29mod cache;
30/// Module containing all typed constants
31pub mod consts;
32#[cfg(feature = "deprecated")]
33mod deprecated;
34mod dev;
35mod devno;
36mod encode;
37mod err;
38mod partition;
39mod probe;
40mod tag;
41mod topology;
42mod utils;
43mod version;
44
45pub use uuid::Uuid;
46
47pub use libblkid_rs_sys::blkid_loff_t;
48
49pub use crate::{
50    cache::BlkidCache,
51    consts::*,
52    dev::{BlkidDev, BlkidDevIter},
53    devno::{maj_t, min_t, BlkidDevno},
54    encode::{encode_string, safe_string},
55    err::{BlkidErr, Result},
56    partition::{BlkidPartition, BlkidPartlist, BlkidParttable},
57    probe::{
58        get_partition_name, get_superblock_name, is_known_fs_type, is_known_partition_type,
59        BlkidProbe,
60    },
61    tag::{parse_tag_string, BlkidTagIter},
62    topology::BlkidTopology,
63    utils::{evaluate_spec, evaluate_tag, send_uevent, BlkidSectors},
64    version::{get_library_version, parse_version_string},
65};