libmtp

Crates.iolibmtp
lib.rslibmtp
version0.4.2
created_at2025-06-28 21:27:56.863077+00
updated_at2025-07-13 12:03:26.086539+00
descriptionA memory safe API for interacting with libmtp library
homepage
repositoryhttps://codeberg.org/frofor/libmtp
max_upload_size
id1730138
size106,597
(frofor)

documentation

README

libmtp

A memory safe API for interacting with libmtp library in Rust.

crates.io

Install

To install the latest version of libmtp from crates.io, run:

$ cargo add libmtp

Getting started

To get started, create a new program that prints all objects in the root folder of your storage:

use libmtp::search_raw_devices;

fn main() -> libmtp::Result<()> {
	for device in search_raw_devices()?.filter_map(|r| r.open_uncached()) {
		for storage in &device {
			for object in &storage {
				println!("{object:?}");
			}
		}
	}
	Ok(())
}

For more examples, see examples.

Changelog

For a release history, see CHANGELOG.md.

Contributing

For a contibuting guide, see CONTRIBUTING.md.

License

This crate is distributed under the terms of MIT License.

See LICENSE for details.

Commit count: 0

cargo fmt