[][src]Crate libmtp_rs

This crate aims to provide a flexible and high-level interface to the libmtp library, at its current state is alpha software and may not be used in production since some features are still missing, said this contributions are welcome.

The usual way to start using this library is with the detect_raw_devices function which returns a list of RawDevices, i.e. the connected USB devices, using these devices you can open an MtpDevice, with this you can gather device properties like manufacturer, model, battery level, etc; and manage objects like files, tracks, albums, etc with Storage and StoragePool.

Here we list the more important modules:

  • device: Gather/set properties and obtain storage.
  • storage: Send/get objects (files, tracks, etc) and manage storage.
  • object: Copying, moving and deleting objects.

Aditionally if you want a more low-level control on the attributes of certain objects you may want to check the methods to get and set properties in the Object trait to see how to use it with instances of its implementors.


pub use chrono;



This module groups all the operations you can do on an MTP device, like gathering information, properties, support for filetypes, and update/gather storage in order to be able to send or get files, folders, tracks, etc.


This module contains information about possible errors, such as internal and libmtp errors.


Module to manage some internal functionality of libmtp like debug levels and the supported devices, you won't usually use it.


Everything on the Media Transfer Protocol is an object, this module groups common behavior and items of many higher abstractions like files, tracks, albums, etc.


Module with Storage and StoragePool that are able to manage the storage of an specific device, and perform certain operations like sending and getting files, tracks, etc.


Utilities that doesn't fit anywhere else, mostly contains internal crate functions (which are not public) and other useful public items.


This module contains items used to determine which values are allowed to be used on certain object attributes (aka properties).

Type Definitions


Custom Result type, this is the most used Result in this crate.