Add support for compressing to .tgz, add gio network mount example
This commit is contained in:
parent
c4c92be708
commit
4374132e2f
6 changed files with 219 additions and 135 deletions
23
examples/mount.rs
Normal file
23
examples/mount.rs
Normal 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);
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue