Add mounter abstraction, enable minimal GVfs support
This commit is contained in:
parent
8913c4198b
commit
02b6cda872
8 changed files with 254 additions and 19 deletions
25
examples/gvfs.rs
Normal file
25
examples/gvfs.rs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
use gio::prelude::*;
|
||||
|
||||
fn main() {
|
||||
let monitor = gio::VolumeMonitor::get();
|
||||
for drive in monitor.connected_drives() {
|
||||
println!("Drive: {}", drive.name());
|
||||
for volume in drive.volumes() {
|
||||
println!(" Volume: {}", volume.name());
|
||||
if let Some(mount) = volume.get_mount() {
|
||||
println!(" Mount: {}", mount.name());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for mount in monitor.mounts() {
|
||||
println!("Mount: {}", mount.name());
|
||||
}
|
||||
|
||||
for volume in monitor.volumes() {
|
||||
println!("Volume: {}", volume.name());
|
||||
if let Some(mount) = volume.get_mount() {
|
||||
println!(" Mount: {}", mount.name());
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue