libmtp_rs/lib.rs
1//! This crate aims to provide a flexible and high-level interface to the `libmtp` library, at
2//! its current state is alpha software and may not be used in production since some features
3//! are still missing, said this contributions are welcome.
4//!
5//! The usual way to start using this library is with the
6//! [`detect_raw_devices`](device/raw/index.html) function which returns a list of
7//! [`RawDevice`](device/raw/struct.RawDevice.html)s, i.e. the connected USB devices, using these
8//! devices you can open an [`MtpDevice`](device/struct.MtpDevice.html), with this you can gather
9//! device properties like manufacturer, model, battery level, etc; and manage objects like files,
10//! tracks, albums, etc with [`Storage`](storage/struct.Storage.html) and [`StoragePool`](storage/struct.StoragePool.html).
11//!
12//! Here we list the more important modules:
13//! - [`device`](device/index.html): Gather/set properties and obtain storage.
14//! - [`storage`](storage/index.html): Send/get objects (files, tracks, etc) and manage storage.
15//! - [`object`](object/index.html): Copying, moving and deleting objects.
16//!
17//! Aditionally if you want a more low-level control on the attributes of certain objects you may
18//! want to check the methods to get and set properties in the [`Object`](object/trait.Object.html)
19//! trait to see how to use it with instances of its [implementors](trait.Object.html#implementors).
20
21use error::Error;
22
23#[macro_use]
24mod macros;
25
26pub mod error;
27pub mod internals;
28
29pub mod util;
30
31pub mod values;
32
33pub mod device;
34pub mod object;
35pub mod storage;
36
37/// Re-export for support convenience.
38pub use chrono;
39
40/// Custom Result type, this is the most used Result in this crate.
41pub type Result<T> = std::result::Result<T, Error>;