| Crates.io | libmtp |
| lib.rs | libmtp |
| version | 0.5.1 |
| created_at | 2025-06-28 21:27:56.863077+00 |
| updated_at | 2025-10-12 17:38:52.014548+00 |
| description | A memory safe API for interacting with libmtp library |
| homepage | |
| repository | https://codeberg.org/frofor/libmtp |
| max_upload_size | |
| id | 1730138 |
| size | 105,459 |
A memory safe API for interacting with libmtp library in Rust.
To install the latest version of the crate from crates.io, run:
$ cargo add libmtp
To get started, create a new program that prints all objects in the root folder of your storage:
use libmtp::RawDevice;
use libmtp::search_raw_devices;
fn main() -> libmtp::Result<()> {
for device in search_raw_devices()?.filter_map(RawDevice::open_uncached) {
for storage in &device {
for object in &storage {
println!("{object:?}");
}
}
}
Ok(())
}
For more examples, see examples.
For a release history, see CHANGELOG.md.
For a contibuting guide, see CONTRIBUTING.md.
This crate is distributed under the terms of MIT License.
See LICENSE for details.