#file-transfer #android #api-bindings

libmtp

A memory safe API for interacting with libmtp library

14 releases (4 breaking)

Uses new Rust 2024

0.5.1 Oct 12, 2025
0.5.0 Oct 12, 2025
0.4.2 Jul 13, 2025
0.3.5 Jul 2, 2025
0.1.0 Jun 28, 2025

#66 in Multimedia

Download history 81/week @ 2025-07-14 29/week @ 2025-07-21 11/week @ 2025-07-28 1/week @ 2025-08-18 194/week @ 2025-10-06 148/week @ 2025-10-13 12/week @ 2025-10-20 1/week @ 2025-10-27

355 downloads per month

MIT license

97KB
2.5K SLoC

libmtp

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

crates.io

Installation

To install the latest version of the crate 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::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.

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.

Dependencies