libmtp/
lib.rs

1//! A memory safe API for interacting with libmtp library.
2//!
3//! [![crates.io](https://img.shields.io/crates/v/libmtp)](https://crates.io/crates/libmtp)
4//!
5//! ## Install
6//!
7//! To install the latest version of the crate from [crates.io](https://crates.io/crates/libmtp),
8//! run:
9//!
10//! ```sh
11//! $ cargo add libmtp
12//! ```
13//!
14//! ## Getting started
15//!
16//! To get started, create a new program that prints all objects in the root folder of your storage:
17//!
18//! ```no_run
19//! use libmtp::RawDevice;
20//! use libmtp::search_raw_devices;
21//!
22//! fn main() -> libmtp::Result<()> {
23//!     for device in search_raw_devices()?.filter_map(RawDevice::open_uncached) {
24//!         for storage in &device {
25//!             for object in &storage {
26//!                 println!("{object:?}");
27//!             }
28//!         }
29//!     }
30//!     Ok(())
31//! }
32//! ```
33//!
34//! For more examples, see [examples](https://codeberg.org/frofor/libmtp/src/branch/main/examples).
35//!
36//! ## Changelog
37//!
38//! For a release history, see
39//! [CHANGELOG.md](https://codeberg.org/frofor/libmtp/src/branch/main/doc/CHANGELOG.md).
40//!
41//! ## Contributing
42//!
43//! For a contibuting guide, see
44//! [CONTRIBUTING.md](https://codeberg.org/frofor/libmtp/src/branch/main/doc/CONTRIBUTING.md).
45//!
46//! ## License
47//!
48//! This crate is distributed under the terms of MIT License.
49//!
50//! See [LICENSE](https://codeberg.org/frofor/libmtp/src/branch/main/LICENSE) for details.
51
52#![warn(clippy::pedantic)]
53#![warn(clippy::cargo)]
54
55pub(crate) mod convert;
56mod dev;
57mod err;
58pub(crate) mod ffi;
59mod obj;
60mod storage;
61
62pub use dev::*;
63pub use err::*;
64pub use obj::*;
65pub use storage::*;