5 unstable releases

0.3.1 Aug 4, 2024
0.3.0 Jan 1, 2024
0.2.1 Jul 26, 2023
0.2.0 Jun 1, 2023
0.1.0 Mar 31, 2023

#106 in Multimedia

Download history 89/week @ 2024-07-30 25/week @ 2024-08-06 7/week @ 2024-09-10 6/week @ 2024-09-17 30/week @ 2024-09-24 14/week @ 2024-10-01

234 downloads per month

MIT license

4MB
890 lines

Rust wrappers over Windows COM API for MTP (Media Transfer Protocol).

What this is for

This makes it possible to use the Media Transfer Protocol on Windows, e.g. to transfer files to and from an Android device.

Documentation

Documentation of this crate can be found on docs.rs


lib.rs:

Safe Rust abstraction over Windows MTP API

Microsoft provides a COM API for WPD (Windows Portable Devices).
It also provides raw bindings over these COM APIs.

This create provides a safe Rust abstraction over this API.

What is MTP

MTP stands for "Media Transfer Protocol". This is how many devices expose themselves when plugged by USB.
Most (every?) Android device supports it.

Important note

The WPD API is fairly large. This crate only provides a small fraction of what is possible.
Basically, only device enumeration, simple content enumeration, and content transfer from and to devices that expose disk-like contents are implemented.

Much of this crate implements features from code samples at https://github.com/microsoft/Windows-classic-samples/blob/HEAD/Samples/PortableDeviceCOM/.
Much can be added in the future. Contributions are welcome!

Usage

The entry point of this library is to create a Provider, e.g. by Provider::new. Other structs can be created from its various methods.

Dependencies

~127MB
~2M SLoC