Add support for compressing to .tgz, add gio network mount example

This commit is contained in:
Jeremy Soller 2024-09-10 11:50:14 -06:00
parent c4c92be708
commit 4374132e2f
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
6 changed files with 219 additions and 135 deletions

23
examples/mount.rs Normal file
View file

@ -0,0 +1,23 @@
use gio::prelude::*;
use std::env;
fn main() {
let uri = env::args().nth(1).expect("no uri provided");
let context = glib::MainContext::new();
context.block_on(async {
let mount_op = gio::MountOperation::new();
mount_op.connect_ask_password(|mount_op, message, default_user, default_domain, flags| {
println!(
"{}, {}, {}, {:?}",
message, default_user, default_domain, flags
);
mount_op.set_anonymous(true);
mount_op.reply(gio::MountOperationResult::Handled);
});
let file = gio::File::for_uri(&uri);
let res = file
.mount_enclosing_volume_future(gio::MountMountFlags::empty(), Some(&mount_op))
.await;
println!("{:?}", res);
});
}