4 releases (2 breaking)

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

#112 in Multimedia

22 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

~153MB
~2.5M SLoC