Add mounter abstraction, enable minimal GVfs support

This commit is contained in:
Jeremy Soller 2024-04-22 09:54:00 -06:00
parent 8913c4198b
commit 02b6cda872
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
8 changed files with 254 additions and 19 deletions

25
examples/gvfs.rs Normal file
View 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());
}
}
}