libmtp 0.3.5

A memory safe API for interacting with libmtp library
Documentation

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

Get Started

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

use libmtp::dev::discover;

fn main() -> libmtp::Result<()> {
	for device in discover()?.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.