Expand description
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.
Modules§
- Portable
Devices - Re-exported from the windows-rs crate, because it is used in our public API.
Required features:"Win32_Devices_PortableDevices"
- device
- error
- io
- Adapters so that COM streams implement
std::io::Read
andstd::io::Write
- object
- MTP object (can be a folder, a file, etc.)
- utils
Macros§
- make_
current_ app_ identifiers - Create an instance of
AppIdentifiers
with the values of the current app.
Structs§
- PROPERTYKEY
- Re-exported from the windows-rs crate, because it is used in our public API.
- Provider
- Windows
Error - Re-exported from the windows-rs crate, because it is used in our public API.
An error object consists of both an error code as well as detailed error information for debugging.
Type Aliases§
- Windows
Result - Re-exported from the windows-rs crate, because it is used in our public API.
A specializedResult
type that provides Windows error information.