1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Configuration types for virtual MTP devices.
use PathBuf;
use Duration;
/// Configuration for a virtual MTP device.
///
/// Defines the identity and storages of a virtual device that operates against
/// a local filesystem directory instead of real USB hardware.
///
/// # Example
///
/// ```rust
/// use std::path::PathBuf;
/// use std::time::Duration;
/// use mtp_rs::transport::virtual_device::config::{VirtualDeviceConfig, VirtualStorageConfig};
///
/// let config = VirtualDeviceConfig {
/// manufacturer: "Google".into(),
/// model: "Virtual Pixel 9".into(),
/// serial: "virtual-001".into(),
/// storages: vec![VirtualStorageConfig {
/// description: "Internal Storage".into(),
/// capacity: 64 * 1024 * 1024 * 1024,
/// backing_dir: PathBuf::from("/tmp/mtp-test"),
/// read_only: false,
/// }],
/// supports_rename: true,
/// event_poll_interval: Duration::from_millis(50),
/// };
/// ```
/// Configuration for a single storage within a virtual device.