Update glib + gir and regenerate

This commit is contained in:
Felix Krull 2019-12-15 14:05:17 +01:00 committed by Colin Walters
parent 28407036b1
commit 241806b757
25 changed files with 337 additions and 356 deletions

View File

@ -37,11 +37,11 @@ bitflags = "1"
fragile = { version = "0.3.0", optional = true }
futures-preview = { version = "0.3.0-alpha", optional = true }
lazy_static = "1.1"
glib = "0.8.0"
gio = "0.7.0"
glib-sys = "0.9.0"
gobject-sys = "0.9.0"
gio-sys = "0.9.0"
glib = "0.9.0"
gio = "0.8.0"
glib-sys = "0.9.1"
gobject-sys = "0.9.1"
gio-sys = "0.9.1"
ostree-sys = { version = "0.5.2", path = "sys" }
[dev-dependencies]

View File

@ -1,3 +1,6 @@
GIR_VERSION := d1e88f94e89a84d7aae7a51b3ff46b71838c42ff
RUSTDOC_STRIPPER_VERSION := 0.1.9
all: gir
.PHONY: gir gir-report update-gir-files remove-gir-files merge-lgpl-docs
@ -5,7 +8,7 @@ all: gir
# -- gir generation --
target/tools/bin/gir:
cargo install --root target/tools --git https://github.com/gtk-rs/gir.git --rev c0f523f42d1c54e3489ae33e5464ecaaf0db3fd4 -- gir
cargo install --root target/tools --git https://github.com/gtk-rs/gir.git --rev $(GIR_VERSION) -- gir
gir: target/tools/bin/gir
target/tools/bin/gir -c conf/ostree-sys.toml
@ -17,7 +20,7 @@ gir-report: gir
# -- LGPL docs generation --
target/tools/bin/rustdoc-stripper:
cargo install --root target/tools --version 0.1.5 -- rustdoc-stripper
cargo install --root target/tools --version $(RUSTDOC_STRIPPER_VERSION) -- rustdoc-stripper
merge-lgpl-docs: target/tools/bin/gir target/tools/bin/rustdoc-stripper
target/tools/bin/gir -c conf/ostree.toml -m doc

View File

@ -4,13 +4,13 @@
#[cfg(any(feature = "v2017_6", feature = "dox"))]
use glib;
#[cfg(any(feature = "v2017_6", feature = "dox"))]
use glib::GString;
use glib::object::Cast;
use glib::object::IsA;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
#[cfg(any(feature = "v2017_6", feature = "dox"))]
use glib::GString;
use glib_sys;
use ostree_sys;
use std::boxed::Box as Box_;

View File

@ -2,11 +2,11 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Error;
use gio;
use glib::GString;
use glib;
use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use ostree_sys;
use std::fmt;
use std::ptr;
@ -38,7 +38,7 @@ impl BootconfigParser {
}
}
pub fn parse<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, path: &P, cancellable: Option<&Q>) -> Result<(), Error> {
pub fn parse<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, path: &P, cancellable: Option<&Q>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_bootconfig_parser_parse(self.to_glib_none().0, path.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -46,7 +46,7 @@ impl BootconfigParser {
}
}
pub fn parse_at<P: IsA<gio::Cancellable>>(&self, dfd: i32, path: &str, cancellable: Option<&P>) -> Result<(), Error> {
pub fn parse_at<P: IsA<gio::Cancellable>>(&self, dfd: i32, path: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_bootconfig_parser_parse_at(self.to_glib_none().0, dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -60,7 +60,7 @@ impl BootconfigParser {
}
}
pub fn write<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, output: &P, cancellable: Option<&Q>) -> Result<(), Error> {
pub fn write<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, output: &P, cancellable: Option<&Q>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_bootconfig_parser_write(self.to_glib_none().0, output.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -68,7 +68,7 @@ impl BootconfigParser {
}
}
pub fn write_at<P: IsA<gio::Cancellable>>(&self, dfd: i32, path: &str, cancellable: Option<&P>) -> Result<(), Error> {
pub fn write_at<P: IsA<gio::Cancellable>>(&self, dfd: i32, path: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_bootconfig_parser_write_at(self.to_glib_none().0, dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);

View File

@ -2,15 +2,15 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use BootconfigParser;
#[cfg(any(feature = "v2016_4", feature = "dox"))]
use DeploymentUnlockedState;
use glib;
use glib::GString;
use glib::translate::*;
use glib::GString;
use glib_sys;
use ostree_sys;
use std::fmt;
use BootconfigParser;
#[cfg(any(feature = "v2016_4", feature = "dox"))]
use DeploymentUnlockedState;
glib_wrapper! {
pub struct Deployment(Object<ostree_sys::OstreeDeployment, DeploymentClass>);

View File

@ -2,13 +2,13 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use glib::StaticType;
use glib::Type;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::FromValueOptional;
use glib::value::SetValue;
use glib::value::Value;
use glib::StaticType;
use glib::Type;
use gobject_sys;
use ostree_sys;

View File

@ -2,20 +2,19 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Error;
use ObjectType;
use gio;
use glib;
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use ostree_sys;
use std::mem;
use std::ptr;
use ObjectType;
#[cfg(any(feature = "v2017_15", feature = "dox"))]
pub fn break_hardlink<P: IsA<gio::Cancellable>>(dfd: i32, path: &str, skip_xattrs: bool, cancellable: Option<&P>) -> Result<(), Error> {
pub fn break_hardlink<P: IsA<gio::Cancellable>>(dfd: i32, path: &str, skip_xattrs: bool, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_break_hardlink(dfd, path.to_glib_none().0, skip_xattrs.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -52,24 +51,24 @@ pub fn check_version(required_year: u32, required_release: u32) -> bool {
// unsafe { TODO: call ostree_sys:ostree_checksum_bytes_peek() }
//}
//pub fn checksum_bytes_peek_validate(bytes: &glib::Variant) -> Result</*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, Error> {
//pub fn checksum_bytes_peek_validate(bytes: &glib::Variant) -> Result</*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_checksum_bytes_peek_validate() }
//}
//pub fn checksum_file<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(f: &P, objtype: ObjectType, out_csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Option<&Q>) -> Result<(), Error> {
//pub fn checksum_file<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(f: &P, objtype: ObjectType, out_csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Option<&Q>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_checksum_file() }
//}
//pub fn checksum_file_async<P: IsA<gio::File>, Q: IsA<gio::Cancellable>, R: FnOnce(Result<(), Error>) + 'static>(f: &P, objtype: ObjectType, io_priority: i32, cancellable: Option<&Q>, callback: R) {
//pub fn checksum_file_async<P: IsA<gio::File>, Q: IsA<gio::Cancellable>, R: FnOnce(Result<(), glib::Error>) + 'static>(f: &P, objtype: ObjectType, io_priority: i32, cancellable: Option<&Q>, callback: R) {
// unsafe { TODO: call ostree_sys:ostree_checksum_file_async() }
//}
//#[cfg(any(feature = "v2017_13", feature = "dox"))]
//pub fn checksum_file_at<P: IsA<gio::Cancellable>>(dfd: i32, path: &str, stbuf: /*Unimplemented*/Option<Fundamental: Pointer>, objtype: ObjectType, flags: ChecksumFlags, out_checksum: &str, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn checksum_file_at<P: IsA<gio::Cancellable>>(dfd: i32, path: &str, stbuf: /*Unimplemented*/Option<Fundamental: Pointer>, objtype: ObjectType, flags: ChecksumFlags, out_checksum: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_checksum_file_at() }
//}
//pub fn checksum_file_from_input<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, in_: Option<&P>, objtype: ObjectType, out_csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Option<&Q>) -> Result<(), Error> {
//pub fn checksum_file_from_input<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, in_: Option<&P>, objtype: ObjectType, out_csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Option<&Q>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_checksum_file_from_input() }
//}
@ -120,7 +119,7 @@ pub fn commit_get_timestamp(commit_variant: &glib::Variant) -> u64 {
}
}
pub fn content_file_parse<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(compressed: bool, content_path: &P, trusted: bool, cancellable: Option<&Q>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), Error> {
pub fn content_file_parse<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(compressed: bool, content_path: &P, trusted: bool, cancellable: Option<&Q>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), glib::Error> {
unsafe {
let mut out_input = ptr::null_mut();
let mut out_file_info = ptr::null_mut();
@ -131,7 +130,7 @@ pub fn content_file_parse<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(compresse
}
}
pub fn content_file_parse_at<P: IsA<gio::Cancellable>>(compressed: bool, parent_dfd: i32, path: &str, trusted: bool, cancellable: Option<&P>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), Error> {
pub fn content_file_parse_at<P: IsA<gio::Cancellable>>(compressed: bool, parent_dfd: i32, path: &str, trusted: bool, cancellable: Option<&P>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), glib::Error> {
unsafe {
let mut out_input = ptr::null_mut();
let mut out_file_info = ptr::null_mut();
@ -142,7 +141,7 @@ pub fn content_file_parse_at<P: IsA<gio::Cancellable>>(compressed: bool, parent_
}
}
pub fn content_stream_parse<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(compressed: bool, input: &P, input_length: u64, trusted: bool, cancellable: Option<&Q>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), Error> {
pub fn content_stream_parse<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(compressed: bool, input: &P, input_length: u64, trusted: bool, cancellable: Option<&Q>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), glib::Error> {
unsafe {
let mut out_input = ptr::null_mut();
let mut out_file_info = ptr::null_mut();
@ -159,12 +158,12 @@ pub fn create_directory_metadata(dir_info: &gio::FileInfo, xattrs: Option<&glib:
}
}
//pub fn diff_dirs<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(flags: DiffFlags, a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 25 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, cancellable: Option<&R>) -> Result<(), Error> {
//pub fn diff_dirs<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(flags: DiffFlags, a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 25 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, cancellable: Option<&R>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_diff_dirs() }
//}
//#[cfg(any(feature = "v2017_4", feature = "dox"))]
//pub fn diff_dirs_with_options<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(flags: DiffFlags, a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 25 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, options: /*Ignored*/Option<&mut DiffDirsOptions>, cancellable: Option<&R>) -> Result<(), Error> {
//pub fn diff_dirs_with_options<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(flags: DiffFlags, a: &P, b: &Q, modified: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 25 }, removed: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, added: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 4, id: 15 }, options: /*Ignored*/Option<&mut DiffDirsOptions>, cancellable: Option<&R>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_diff_dirs_with_options() }
//}
@ -233,7 +232,7 @@ pub fn object_type_to_string(objtype: ObjectType) -> Option<GString> {
}
}
pub fn parse_refspec(refspec: &str) -> Result<(Option<GString>, GString), Error> {
pub fn parse_refspec(refspec: &str) -> Result<(Option<GString>, GString), glib::Error> {
unsafe {
let mut out_remote = ptr::null_mut();
let mut out_ref = ptr::null_mut();
@ -244,7 +243,7 @@ pub fn parse_refspec(refspec: &str) -> Result<(Option<GString>, GString), Error>
}
#[cfg(any(feature = "v2016_6", feature = "dox"))]
pub fn raw_file_to_archive_z2_stream<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(input: &P, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<gio::InputStream, Error> {
pub fn raw_file_to_archive_z2_stream<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(input: &P, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<gio::InputStream, glib::Error> {
unsafe {
let mut out_input = ptr::null_mut();
let mut error = ptr::null_mut();
@ -254,7 +253,7 @@ pub fn raw_file_to_archive_z2_stream<P: IsA<gio::InputStream>, Q: IsA<gio::Cance
}
#[cfg(any(feature = "v2017_3", feature = "dox"))]
pub fn raw_file_to_archive_z2_stream_with_options<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(input: &P, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, options: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<gio::InputStream, Error> {
pub fn raw_file_to_archive_z2_stream_with_options<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(input: &P, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, options: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<gio::InputStream, glib::Error> {
unsafe {
let mut out_input = ptr::null_mut();
let mut error = ptr::null_mut();
@ -263,7 +262,7 @@ pub fn raw_file_to_archive_z2_stream_with_options<P: IsA<gio::InputStream>, Q: I
}
}
pub fn raw_file_to_content_stream<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(input: &P, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<(gio::InputStream, u64), Error> {
pub fn raw_file_to_content_stream<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(input: &P, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<(gio::InputStream, u64), glib::Error> {
unsafe {
let mut out_input = ptr::null_mut();
let mut out_length = mem::MaybeUninit::uninit();
@ -274,7 +273,7 @@ pub fn raw_file_to_content_stream<P: IsA<gio::InputStream>, Q: IsA<gio::Cancella
}
}
pub fn validate_checksum_string(sha256: &str) -> Result<(), Error> {
pub fn validate_checksum_string(sha256: &str) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_validate_checksum_string(sha256.to_glib_none().0, &mut error);
@ -283,7 +282,7 @@ pub fn validate_checksum_string(sha256: &str) -> Result<(), Error> {
}
#[cfg(any(feature = "v2018_6", feature = "dox"))]
pub fn validate_collection_id(collection_id: Option<&str>) -> Result<(), Error> {
pub fn validate_collection_id(collection_id: Option<&str>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_validate_collection_id(collection_id.to_glib_none().0, &mut error);
@ -292,7 +291,7 @@ pub fn validate_collection_id(collection_id: Option<&str>) -> Result<(), Error>
}
#[cfg(any(feature = "v2017_8", feature = "dox"))]
pub fn validate_remote_name(remote_name: &str) -> Result<(), Error> {
pub fn validate_remote_name(remote_name: &str) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_validate_remote_name(remote_name.to_glib_none().0, &mut error);
@ -300,7 +299,7 @@ pub fn validate_remote_name(remote_name: &str) -> Result<(), Error> {
}
}
pub fn validate_rev(rev: &str) -> Result<(), Error> {
pub fn validate_rev(rev: &str) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_validate_rev(rev.to_glib_none().0, &mut error);
@ -308,7 +307,7 @@ pub fn validate_rev(rev: &str) -> Result<(), Error> {
}
}
pub fn validate_structureof_checksum_string(checksum: &str) -> Result<(), Error> {
pub fn validate_structureof_checksum_string(checksum: &str) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_validate_structureof_checksum_string(checksum.to_glib_none().0, &mut error);
@ -316,7 +315,7 @@ pub fn validate_structureof_checksum_string(checksum: &str) -> Result<(), Error>
}
}
pub fn validate_structureof_commit(commit: &glib::Variant) -> Result<(), Error> {
pub fn validate_structureof_commit(commit: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_validate_structureof_commit(commit.to_glib_none().0, &mut error);
@ -324,7 +323,7 @@ pub fn validate_structureof_commit(commit: &glib::Variant) -> Result<(), Error>
}
}
pub fn validate_structureof_csum_v(checksum: &glib::Variant) -> Result<(), Error> {
pub fn validate_structureof_csum_v(checksum: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_validate_structureof_csum_v(checksum.to_glib_none().0, &mut error);
@ -332,7 +331,7 @@ pub fn validate_structureof_csum_v(checksum: &glib::Variant) -> Result<(), Error
}
}
pub fn validate_structureof_dirmeta(dirmeta: &glib::Variant) -> Result<(), Error> {
pub fn validate_structureof_dirmeta(dirmeta: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_validate_structureof_dirmeta(dirmeta.to_glib_none().0, &mut error);
@ -340,7 +339,7 @@ pub fn validate_structureof_dirmeta(dirmeta: &glib::Variant) -> Result<(), Error
}
}
pub fn validate_structureof_dirtree(dirtree: &glib::Variant) -> Result<(), Error> {
pub fn validate_structureof_dirtree(dirtree: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_validate_structureof_dirtree(dirtree.to_glib_none().0, &mut error);
@ -348,7 +347,7 @@ pub fn validate_structureof_dirtree(dirtree: &glib::Variant) -> Result<(), Error
}
}
pub fn validate_structureof_file_mode(mode: u32) -> Result<(), Error> {
pub fn validate_structureof_file_mode(mode: u32) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_validate_structureof_file_mode(mode, &mut error);
@ -356,7 +355,7 @@ pub fn validate_structureof_file_mode(mode: u32) -> Result<(), Error> {
}
}
pub fn validate_structureof_objtype(objtype: u8) -> Result<(), Error> {
pub fn validate_structureof_objtype(objtype: u8) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_validate_structureof_objtype(objtype, &mut error);

View File

@ -2,9 +2,6 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
#[cfg(any(feature = "v2016_6", feature = "dox"))]
use Error;
use GpgSignatureFormatFlags;
use glib;
use glib::translate::*;
use ostree_sys;
@ -12,6 +9,7 @@ use std::fmt;
use std::mem;
#[cfg(any(feature = "v2016_6", feature = "dox"))]
use std::ptr;
use GpgSignatureFormatFlags;
glib_wrapper! {
pub struct GpgVerifyResult(Object<ostree_sys::OstreeGpgVerifyResult, GpgVerifyResultClass>);
@ -60,7 +58,7 @@ impl GpgVerifyResult {
}
#[cfg(any(feature = "v2016_6", feature = "dox"))]
pub fn require_valid_signature(&self) -> Result<(), Error> {
pub fn require_valid_signature(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_gpg_verify_result_require_valid_signature(self.to_glib_none().0, &mut error);

View File

@ -2,15 +2,15 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Error;
#[cfg(any(feature = "v2018_7", feature = "dox"))]
use Repo;
use glib::GString;
use glib;
use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use ostree_sys;
use std::fmt;
use std::ptr;
#[cfg(any(feature = "v2018_7", feature = "dox"))]
use Repo;
glib_wrapper! {
pub struct MutableTree(Object<ostree_sys::OstreeMutableTree, ostree_sys::OstreeMutableTreeClass, MutableTreeClass>);
@ -45,11 +45,11 @@ pub const NONE_MUTABLE_TREE: Option<&MutableTree> = None;
pub trait MutableTreeExt: 'static {
#[cfg(any(feature = "v2018_7", feature = "dox"))]
fn check_error(&self) -> Result<(), Error>;
fn check_error(&self) -> Result<(), glib::Error>;
fn ensure_dir(&self, name: &str) -> Result<MutableTree, Error>;
fn ensure_dir(&self, name: &str) -> Result<MutableTree, glib::Error>;
//fn ensure_parent_dirs(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, metadata_checksum: &str) -> Result<MutableTree, Error>;
//fn ensure_parent_dirs(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, metadata_checksum: &str) -> Result<MutableTree, glib::Error>;
#[cfg(any(feature = "v2018_7", feature = "dox"))]
fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool;
@ -62,23 +62,23 @@ pub trait MutableTreeExt: 'static {
//fn get_subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 40 };
fn lookup(&self, name: &str) -> Result<(GString, MutableTree), Error>;
fn lookup(&self, name: &str) -> Result<(GString, MutableTree), glib::Error>;
#[cfg(any(feature = "v2018_9", feature = "dox"))]
fn remove(&self, name: &str, allow_noent: bool) -> Result<(), Error>;
fn remove(&self, name: &str, allow_noent: bool) -> Result<(), glib::Error>;
fn replace_file(&self, name: &str, checksum: &str) -> Result<(), Error>;
fn replace_file(&self, name: &str, checksum: &str) -> Result<(), glib::Error>;
fn set_contents_checksum(&self, checksum: &str);
fn set_metadata_checksum(&self, checksum: &str);
//fn walk(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, start: u32) -> Result<MutableTree, Error>;
//fn walk(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, start: u32) -> Result<MutableTree, glib::Error>;
}
impl<O: IsA<MutableTree>> MutableTreeExt for O {
#[cfg(any(feature = "v2018_7", feature = "dox"))]
fn check_error(&self) -> Result<(), Error> {
fn check_error(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_mutable_tree_check_error(self.as_ref().to_glib_none().0, &mut error);
@ -86,7 +86,7 @@ impl<O: IsA<MutableTree>> MutableTreeExt for O {
}
}
fn ensure_dir(&self, name: &str) -> Result<MutableTree, Error> {
fn ensure_dir(&self, name: &str) -> Result<MutableTree, glib::Error> {
unsafe {
let mut out_subdir = ptr::null_mut();
let mut error = ptr::null_mut();
@ -95,7 +95,7 @@ impl<O: IsA<MutableTree>> MutableTreeExt for O {
}
}
//fn ensure_parent_dirs(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, metadata_checksum: &str) -> Result<MutableTree, Error> {
//fn ensure_parent_dirs(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, metadata_checksum: &str) -> Result<MutableTree, glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_mutable_tree_ensure_parent_dirs() }
//}
@ -126,7 +126,7 @@ impl<O: IsA<MutableTree>> MutableTreeExt for O {
// unsafe { TODO: call ostree_sys:ostree_mutable_tree_get_subdirs() }
//}
fn lookup(&self, name: &str) -> Result<(GString, MutableTree), Error> {
fn lookup(&self, name: &str) -> Result<(GString, MutableTree), glib::Error> {
unsafe {
let mut out_file_checksum = ptr::null_mut();
let mut out_subdir = ptr::null_mut();
@ -137,7 +137,7 @@ impl<O: IsA<MutableTree>> MutableTreeExt for O {
}
#[cfg(any(feature = "v2018_9", feature = "dox"))]
fn remove(&self, name: &str, allow_noent: bool) -> Result<(), Error> {
fn remove(&self, name: &str, allow_noent: bool) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_mutable_tree_remove(self.as_ref().to_glib_none().0, name.to_glib_none().0, allow_noent.to_glib(), &mut error);
@ -145,7 +145,7 @@ impl<O: IsA<MutableTree>> MutableTreeExt for O {
}
}
fn replace_file(&self, name: &str, checksum: &str) -> Result<(), Error> {
fn replace_file(&self, name: &str, checksum: &str) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_mutable_tree_replace_file(self.as_ref().to_glib_none().0, name.to_glib_none().0, checksum.to_glib_none().0, &mut error);
@ -165,7 +165,7 @@ impl<O: IsA<MutableTree>> MutableTreeExt for O {
}
}
//fn walk(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, start: u32) -> Result<MutableTree, Error> {
//fn walk(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, start: u32) -> Result<MutableTree, glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_mutable_tree_walk() }
//}
}

View File

@ -2,10 +2,10 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
#[cfg(any(feature = "v2018_6", feature = "dox"))]
use glib::GString;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
use glib::translate::*;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
use glib::GString;
use ostree_sys;
glib_wrapper! {

View File

@ -2,10 +2,30 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use gio;
use glib;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib_sys;
use gobject_sys;
use libc;
use ostree_sys;
#[cfg(any(feature = "v2016_8", feature = "dox"))]
use std;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem;
use std::mem::transmute;
use std::ptr;
use AsyncProgress;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
use CollectionRef;
use Error;
use GpgVerifyResult;
use MutableTree;
use ObjectType;
@ -29,27 +49,6 @@ use RepoRemoteChange;
use RepoResolveRevExtFlags;
use RepoTransactionStats;
use StaticDeltaGenerateOpt;
use gio;
use glib;
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::signal::SignalHandlerId;
use glib::signal::connect_raw;
use glib::translate::*;
use glib_sys;
use gobject_sys;
use libc;
use ostree_sys;
#[cfg(any(feature = "v2016_8", feature = "dox"))]
use std;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem;
use std::mem::transmute;
use std::ptr;
glib_wrapper! {
pub struct Repo(Object<ostree_sys::OstreeRepo, RepoClass>);
@ -78,7 +77,7 @@ impl Repo {
}
}
pub fn abort_transaction<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
pub fn abort_transaction<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_abort_transaction(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -86,7 +85,7 @@ impl Repo {
}
}
pub fn add_gpg_signature_summary<P: IsA<gio::Cancellable>>(&self, key_id: &[&str], homedir: Option<&str>, cancellable: Option<&P>) -> Result<(), Error> {
pub fn add_gpg_signature_summary<P: IsA<gio::Cancellable>>(&self, key_id: &[&str], homedir: Option<&str>, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_add_gpg_signature_summary(self.to_glib_none().0, key_id.to_glib_none().0, homedir.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -94,7 +93,7 @@ impl Repo {
}
}
pub fn append_gpg_signature<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, signature_bytes: &glib::Bytes, cancellable: Option<&P>) -> Result<(), Error> {
pub fn append_gpg_signature<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, signature_bytes: &glib::Bytes, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_append_gpg_signature(self.to_glib_none().0, commit_checksum.to_glib_none().0, signature_bytes.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -103,7 +102,7 @@ impl Repo {
}
#[cfg(any(feature = "v2016_8", feature = "dox"))]
pub fn checkout_at<P: AsRef<std::path::Path>, Q: IsA<gio::Cancellable>>(&self, options: Option<&RepoCheckoutAtOptions>, destination_dfd: i32, destination_path: P, commit: &str, cancellable: Option<&Q>) -> Result<(), Error> {
pub fn checkout_at<P: AsRef<std::path::Path>, Q: IsA<gio::Cancellable>>(&self, options: Option<&RepoCheckoutAtOptions>, destination_dfd: i32, destination_path: P, commit: &str, cancellable: Option<&Q>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_checkout_at(self.to_glib_none().0, mut_override(options.to_glib_none().0), destination_dfd, destination_path.as_ref().to_glib_none().0, commit.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -111,7 +110,7 @@ impl Repo {
}
}
pub fn checkout_gc<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
pub fn checkout_gc<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_checkout_gc(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -119,7 +118,7 @@ impl Repo {
}
}
pub fn checkout_tree<P: IsA<gio::File>, Q: IsA<RepoFile>, R: IsA<gio::Cancellable>>(&self, mode: RepoCheckoutMode, overwrite_mode: RepoCheckoutOverwriteMode, destination: &P, source: &Q, source_info: &gio::FileInfo, cancellable: Option<&R>) -> Result<(), Error> {
pub fn checkout_tree<P: IsA<gio::File>, Q: IsA<RepoFile>, R: IsA<gio::Cancellable>>(&self, mode: RepoCheckoutMode, overwrite_mode: RepoCheckoutOverwriteMode, destination: &P, source: &Q, source_info: &gio::FileInfo, cancellable: Option<&R>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_checkout_tree(self.to_glib_none().0, mode.to_glib(), overwrite_mode.to_glib(), destination.as_ref().to_glib_none().0, source.as_ref().to_glib_none().0, source_info.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -127,7 +126,7 @@ impl Repo {
}
}
pub fn commit_transaction<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<RepoTransactionStats, Error> {
pub fn commit_transaction<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<RepoTransactionStats, glib::Error> {
unsafe {
let mut out_stats = RepoTransactionStats::uninitialized();
let mut error = ptr::null_mut();
@ -142,7 +141,7 @@ impl Repo {
}
}
pub fn create<P: IsA<gio::Cancellable>>(&self, mode: RepoMode, cancellable: Option<&P>) -> Result<(), Error> {
pub fn create<P: IsA<gio::Cancellable>>(&self, mode: RepoMode, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_create(self.to_glib_none().0, mode.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -150,7 +149,7 @@ impl Repo {
}
}
pub fn delete_object<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, sha256: &str, cancellable: Option<&P>) -> Result<(), Error> {
pub fn delete_object<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, sha256: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_delete_object(self.to_glib_none().0, objtype.to_glib(), sha256.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -165,12 +164,12 @@ impl Repo {
}
}
//pub fn export_tree_to_archive<P: IsA<RepoFile>, Q: IsA<gio::Cancellable>>(&self, opts: /*Ignored*/&mut RepoExportArchiveOptions, root: &P, archive: /*Unimplemented*/Option<Fundamental: Pointer>, cancellable: Option<&Q>) -> Result<(), Error> {
//pub fn export_tree_to_archive<P: IsA<RepoFile>, Q: IsA<gio::Cancellable>>(&self, opts: /*Ignored*/&mut RepoExportArchiveOptions, root: &P, archive: /*Unimplemented*/Option<Fundamental: Pointer>, cancellable: Option<&Q>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_export_tree_to_archive() }
//}
#[cfg(any(feature = "v2017_15", feature = "dox"))]
pub fn fsck_object<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, sha256: &str, cancellable: Option<&P>) -> Result<(), Error> {
pub fn fsck_object<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, sha256: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_fsck_object(self.to_glib_none().0, objtype.to_glib(), sha256.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -219,7 +218,7 @@ impl Repo {
}
#[cfg(any(feature = "v2018_9", feature = "dox"))]
pub fn get_min_free_space_bytes(&self) -> Result<u64, Error> {
pub fn get_min_free_space_bytes(&self) -> Result<u64, glib::Error> {
unsafe {
let mut out_reserved_bytes = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
@ -248,7 +247,7 @@ impl Repo {
}
#[cfg(any(feature = "v2016_5", feature = "dox"))]
pub fn get_remote_boolean_option(&self, remote_name: &str, option_name: &str, default_value: bool) -> Result<bool, Error> {
pub fn get_remote_boolean_option(&self, remote_name: &str, option_name: &str, default_value: bool) -> Result<bool, glib::Error> {
unsafe {
let mut out_value = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
@ -259,7 +258,7 @@ impl Repo {
}
#[cfg(any(feature = "v2016_5", feature = "dox"))]
pub fn get_remote_list_option(&self, remote_name: &str, option_name: &str) -> Result<Vec<GString>, Error> {
pub fn get_remote_list_option(&self, remote_name: &str, option_name: &str) -> Result<Vec<GString>, glib::Error> {
unsafe {
let mut out_value = ptr::null_mut();
let mut error = ptr::null_mut();
@ -269,7 +268,7 @@ impl Repo {
}
#[cfg(any(feature = "v2016_5", feature = "dox"))]
pub fn get_remote_option(&self, remote_name: &str, option_name: &str, default_value: Option<&str>) -> Result<GString, Error> {
pub fn get_remote_option(&self, remote_name: &str, option_name: &str, default_value: Option<&str>) -> Result<GString, glib::Error> {
unsafe {
let mut out_value = ptr::null_mut();
let mut error = ptr::null_mut();
@ -279,7 +278,7 @@ impl Repo {
}
#[cfg(any(feature = "v2016_6", feature = "dox"))]
pub fn gpg_verify_data<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(&self, remote_name: Option<&str>, data: &glib::Bytes, signatures: &glib::Bytes, keyringdir: Option<&P>, extra_keyring: Option<&Q>, cancellable: Option<&R>) -> Result<GpgVerifyResult, Error> {
pub fn gpg_verify_data<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(&self, remote_name: Option<&str>, data: &glib::Bytes, signatures: &glib::Bytes, keyringdir: Option<&P>, extra_keyring: Option<&Q>, cancellable: Option<&R>) -> Result<GpgVerifyResult, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ostree_sys::ostree_repo_gpg_verify_data(self.to_glib_none().0, remote_name.to_glib_none().0, data.to_glib_none().0, signatures.to_glib_none().0, keyringdir.map(|p| p.as_ref()).to_glib_none().0, extra_keyring.map(|p| p.as_ref()).to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -287,7 +286,7 @@ impl Repo {
}
}
pub fn has_object<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, checksum: &str, cancellable: Option<&P>) -> Result<bool, Error> {
pub fn has_object<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, checksum: &str, cancellable: Option<&P>) -> Result<bool, glib::Error> {
unsafe {
let mut out_have_object = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
@ -304,11 +303,11 @@ impl Repo {
}
}
//pub fn import_archive_to_mtree<P: IsA<MutableTree>, Q: IsA<gio::Cancellable>>(&self, opts: /*Ignored*/&mut RepoImportArchiveOptions, archive: /*Unimplemented*/Option<Fundamental: Pointer>, mtree: &P, modifier: Option<&RepoCommitModifier>, cancellable: Option<&Q>) -> Result<(), Error> {
//pub fn import_archive_to_mtree<P: IsA<MutableTree>, Q: IsA<gio::Cancellable>>(&self, opts: /*Ignored*/&mut RepoImportArchiveOptions, archive: /*Unimplemented*/Option<Fundamental: Pointer>, mtree: &P, modifier: Option<&RepoCommitModifier>, cancellable: Option<&Q>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_import_archive_to_mtree() }
//}
pub fn import_object_from<P: IsA<gio::Cancellable>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, cancellable: Option<&P>) -> Result<(), Error> {
pub fn import_object_from<P: IsA<gio::Cancellable>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_import_object_from(self.to_glib_none().0, source.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -317,7 +316,7 @@ impl Repo {
}
#[cfg(any(feature = "v2016_5", feature = "dox"))]
pub fn import_object_from_with_trust<P: IsA<gio::Cancellable>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, trusted: bool, cancellable: Option<&P>) -> Result<(), Error> {
pub fn import_object_from_with_trust<P: IsA<gio::Cancellable>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, trusted: bool, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_import_object_from_with_trust(self.to_glib_none().0, source.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, trusted.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -331,7 +330,7 @@ impl Repo {
}
}
pub fn is_writable(&self) -> Result<(), Error> {
pub fn is_writable(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_is_writable(self.to_glib_none().0, &mut error);
@ -340,33 +339,33 @@ impl Repo {
}
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//pub fn list_collection_refs<P: IsA<gio::Cancellable>>(&self, match_collection_id: Option<&str>, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 1, id: 0 }/TypeId { ns_id: 0, id: 28 }, flags: RepoListRefsExtFlags, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn list_collection_refs<P: IsA<gio::Cancellable>>(&self, match_collection_id: Option<&str>, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 1, id: 0 }/TypeId { ns_id: 0, id: 28 }, flags: RepoListRefsExtFlags, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_list_collection_refs() }
//}
//pub fn list_commit_objects_starting_with<P: IsA<gio::Cancellable>>(&self, start: &str, out_commits: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 185 }/TypeId { ns_id: 2, id: 185 }, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn list_commit_objects_starting_with<P: IsA<gio::Cancellable>>(&self, start: &str, out_commits: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 185 }/TypeId { ns_id: 2, id: 185 }, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_list_commit_objects_starting_with() }
//}
//pub fn list_objects<P: IsA<gio::Cancellable>>(&self, flags: RepoListObjectsFlags, out_objects: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 185 }/TypeId { ns_id: 2, id: 185 }, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn list_objects<P: IsA<gio::Cancellable>>(&self, flags: RepoListObjectsFlags, out_objects: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 185 }/TypeId { ns_id: 2, id: 185 }, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_list_objects() }
//}
//pub fn list_refs<P: IsA<gio::Cancellable>>(&self, refspec_prefix: Option<&str>, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn list_refs<P: IsA<gio::Cancellable>>(&self, refspec_prefix: Option<&str>, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_list_refs() }
//}
//#[cfg(any(feature = "v2016_4", feature = "dox"))]
//pub fn list_refs_ext<P: IsA<gio::Cancellable>>(&self, refspec_prefix: Option<&str>, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, flags: RepoListRefsExtFlags, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn list_refs_ext<P: IsA<gio::Cancellable>>(&self, refspec_prefix: Option<&str>, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, flags: RepoListRefsExtFlags, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_list_refs_ext() }
//}
//pub fn list_static_delta_names<P: IsA<gio::Cancellable>>(&self, out_deltas: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn list_static_delta_names<P: IsA<gio::Cancellable>>(&self, out_deltas: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_list_static_delta_names() }
//}
#[cfg(any(feature = "v2015_7", feature = "dox"))]
pub fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, RepoCommitState), Error> {
pub fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, RepoCommitState), glib::Error> {
unsafe {
let mut out_commit = ptr::null_mut();
let mut out_state = mem::MaybeUninit::uninit();
@ -377,7 +376,7 @@ impl Repo {
}
}
pub fn load_file<P: IsA<gio::Cancellable>>(&self, checksum: &str, cancellable: Option<&P>) -> Result<(Option<gio::InputStream>, Option<gio::FileInfo>, Option<glib::Variant>), Error> {
pub fn load_file<P: IsA<gio::Cancellable>>(&self, checksum: &str, cancellable: Option<&P>) -> Result<(Option<gio::InputStream>, Option<gio::FileInfo>, Option<glib::Variant>), glib::Error> {
unsafe {
let mut out_input = ptr::null_mut();
let mut out_file_info = ptr::null_mut();
@ -388,7 +387,7 @@ impl Repo {
}
}
pub fn load_object_stream<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, checksum: &str, cancellable: Option<&P>) -> Result<(gio::InputStream, u64), Error> {
pub fn load_object_stream<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, checksum: &str, cancellable: Option<&P>) -> Result<(gio::InputStream, u64), glib::Error> {
unsafe {
let mut out_input = ptr::null_mut();
let mut out_size = mem::MaybeUninit::uninit();
@ -399,7 +398,7 @@ impl Repo {
}
}
pub fn load_variant(&self, objtype: ObjectType, sha256: &str) -> Result<glib::Variant, Error> {
pub fn load_variant(&self, objtype: ObjectType, sha256: &str) -> Result<glib::Variant, glib::Error> {
unsafe {
let mut out_variant = ptr::null_mut();
let mut error = ptr::null_mut();
@ -408,7 +407,7 @@ impl Repo {
}
}
pub fn load_variant_if_exists(&self, objtype: ObjectType, sha256: &str) -> Result<glib::Variant, Error> {
pub fn load_variant_if_exists(&self, objtype: ObjectType, sha256: &str) -> Result<glib::Variant, glib::Error> {
unsafe {
let mut out_variant = ptr::null_mut();
let mut error = ptr::null_mut();
@ -418,7 +417,7 @@ impl Repo {
}
#[cfg(any(feature = "v2017_15", feature = "dox"))]
pub fn mark_commit_partial(&self, checksum: &str, is_partial: bool) -> Result<(), Error> {
pub fn mark_commit_partial(&self, checksum: &str, is_partial: bool) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_mark_commit_partial(self.to_glib_none().0, checksum.to_glib_none().0, is_partial.to_glib(), &mut error);
@ -427,7 +426,7 @@ impl Repo {
}
#[cfg(any(feature = "v2019_4", feature = "dox"))]
pub fn mark_commit_partial_reason(&self, checksum: &str, is_partial: bool, in_state: RepoCommitState) -> Result<(), Error> {
pub fn mark_commit_partial_reason(&self, checksum: &str, is_partial: bool, in_state: RepoCommitState) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_mark_commit_partial_reason(self.to_glib_none().0, checksum.to_glib_none().0, is_partial.to_glib(), in_state.to_glib(), &mut error);
@ -435,7 +434,7 @@ impl Repo {
}
}
pub fn open<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
pub fn open<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_open(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -443,7 +442,7 @@ impl Repo {
}
}
pub fn prepare_transaction<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<bool, Error> {
pub fn prepare_transaction<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<bool, glib::Error> {
unsafe {
let mut out_transaction_resume = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
@ -453,7 +452,7 @@ impl Repo {
}
}
pub fn prune<P: IsA<gio::Cancellable>>(&self, flags: RepoPruneFlags, depth: i32, cancellable: Option<&P>) -> Result<(i32, i32, u64), Error> {
pub fn prune<P: IsA<gio::Cancellable>>(&self, flags: RepoPruneFlags, depth: i32, cancellable: Option<&P>) -> Result<(i32, i32, u64), glib::Error> {
unsafe {
let mut out_objects_total = mem::MaybeUninit::uninit();
let mut out_objects_pruned = mem::MaybeUninit::uninit();
@ -468,11 +467,11 @@ impl Repo {
}
//#[cfg(any(feature = "v2017_1", feature = "dox"))]
//pub fn prune_from_reachable<P: IsA<gio::Cancellable>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: Option<&P>) -> Result<(i32, i32, u64), Error> {
//pub fn prune_from_reachable<P: IsA<gio::Cancellable>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: Option<&P>) -> Result<(i32, i32, u64), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_prune_from_reachable() }
//}
pub fn prune_static_deltas<P: IsA<gio::Cancellable>>(&self, commit: Option<&str>, cancellable: Option<&P>) -> Result<(), Error> {
pub fn prune_static_deltas<P: IsA<gio::Cancellable>>(&self, commit: Option<&str>, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_prune_static_deltas(self.to_glib_none().0, commit.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -480,7 +479,7 @@ impl Repo {
}
}
pub fn pull<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, remote_name: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<(), Error> {
pub fn pull<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, remote_name: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_pull(self.to_glib_none().0, remote_name.to_glib_none().0, refs_to_fetch.to_glib_none().0, flags.to_glib(), progress.map(|p| p.as_ref()).to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -488,7 +487,7 @@ impl Repo {
}
}
pub fn pull_one_dir<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<(), Error> {
pub fn pull_one_dir<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_pull_one_dir(self.to_glib_none().0, remote_name.to_glib_none().0, dir_to_pull.to_glib_none().0, refs_to_fetch.to_glib_none().0, flags.to_glib(), progress.map(|p| p.as_ref()).to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -496,7 +495,7 @@ impl Repo {
}
}
pub fn pull_with_options<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, remote_name_or_baseurl: &str, options: &glib::Variant, progress: Option<&P>, cancellable: Option<&Q>) -> Result<(), Error> {
pub fn pull_with_options<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, remote_name_or_baseurl: &str, options: &glib::Variant, progress: Option<&P>, cancellable: Option<&Q>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_pull_with_options(self.to_glib_none().0, remote_name_or_baseurl.to_glib_none().0, options.to_glib_none().0, progress.map(|p| p.as_ref()).to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -504,7 +503,7 @@ impl Repo {
}
}
pub fn query_object_storage_size<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, sha256: &str, cancellable: Option<&P>) -> Result<u64, Error> {
pub fn query_object_storage_size<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, sha256: &str, cancellable: Option<&P>) -> Result<u64, glib::Error> {
unsafe {
let mut out_size = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
@ -514,7 +513,7 @@ impl Repo {
}
}
pub fn read_commit<P: IsA<gio::Cancellable>>(&self, ref_: &str, cancellable: Option<&P>) -> Result<(gio::File, GString), Error> {
pub fn read_commit<P: IsA<gio::Cancellable>>(&self, ref_: &str, cancellable: Option<&P>) -> Result<(gio::File, GString), glib::Error> {
unsafe {
let mut out_root = ptr::null_mut();
let mut out_commit = ptr::null_mut();
@ -524,7 +523,7 @@ impl Repo {
}
}
pub fn read_commit_detached_metadata<P: IsA<gio::Cancellable>>(&self, checksum: &str, cancellable: Option<&P>) -> Result<glib::Variant, Error> {
pub fn read_commit_detached_metadata<P: IsA<gio::Cancellable>>(&self, checksum: &str, cancellable: Option<&P>) -> Result<glib::Variant, glib::Error> {
unsafe {
let mut out_metadata = ptr::null_mut();
let mut error = ptr::null_mut();
@ -533,7 +532,7 @@ impl Repo {
}
}
pub fn regenerate_summary<P: IsA<gio::Cancellable>>(&self, additional_metadata: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(), Error> {
pub fn regenerate_summary<P: IsA<gio::Cancellable>>(&self, additional_metadata: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_regenerate_summary(self.to_glib_none().0, additional_metadata.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -542,7 +541,7 @@ impl Repo {
}
#[cfg(any(feature = "v2017_2", feature = "dox"))]
pub fn reload_config<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
pub fn reload_config<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_reload_config(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -550,7 +549,7 @@ impl Repo {
}
}
pub fn remote_add<P: IsA<gio::Cancellable>>(&self, name: &str, url: &str, options: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(), Error> {
pub fn remote_add<P: IsA<gio::Cancellable>>(&self, name: &str, url: &str, options: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_remote_add(self.to_glib_none().0, name.to_glib_none().0, url.to_glib_none().0, options.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -558,7 +557,7 @@ impl Repo {
}
}
pub fn remote_change<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, sysroot: Option<&P>, changeop: RepoRemoteChange, name: &str, url: &str, options: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<(), Error> {
pub fn remote_change<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, sysroot: Option<&P>, changeop: RepoRemoteChange, name: &str, url: &str, options: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_remote_change(self.to_glib_none().0, sysroot.map(|p| p.as_ref()).to_glib_none().0, changeop.to_glib(), name.to_glib_none().0, url.to_glib_none().0, options.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -566,7 +565,7 @@ impl Repo {
}
}
pub fn remote_delete<P: IsA<gio::Cancellable>>(&self, name: &str, cancellable: Option<&P>) -> Result<(), Error> {
pub fn remote_delete<P: IsA<gio::Cancellable>>(&self, name: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_remote_delete(self.to_glib_none().0, name.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -574,7 +573,7 @@ impl Repo {
}
}
pub fn remote_fetch_summary<P: IsA<gio::Cancellable>>(&self, name: &str, cancellable: Option<&P>) -> Result<(glib::Bytes, glib::Bytes), Error> {
pub fn remote_fetch_summary<P: IsA<gio::Cancellable>>(&self, name: &str, cancellable: Option<&P>) -> Result<(glib::Bytes, glib::Bytes), glib::Error> {
unsafe {
let mut out_summary = ptr::null_mut();
let mut out_signatures = ptr::null_mut();
@ -585,7 +584,7 @@ impl Repo {
}
#[cfg(any(feature = "v2016_6", feature = "dox"))]
pub fn remote_fetch_summary_with_options<P: IsA<gio::Cancellable>>(&self, name: &str, options: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(glib::Bytes, glib::Bytes), Error> {
pub fn remote_fetch_summary_with_options<P: IsA<gio::Cancellable>>(&self, name: &str, options: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(glib::Bytes, glib::Bytes), glib::Error> {
unsafe {
let mut out_summary = ptr::null_mut();
let mut out_signatures = ptr::null_mut();
@ -595,7 +594,7 @@ impl Repo {
}
}
pub fn remote_get_gpg_verify(&self, name: &str) -> Result<bool, Error> {
pub fn remote_get_gpg_verify(&self, name: &str) -> Result<bool, glib::Error> {
unsafe {
let mut out_gpg_verify = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
@ -605,7 +604,7 @@ impl Repo {
}
}
pub fn remote_get_gpg_verify_summary(&self, name: &str) -> Result<bool, Error> {
pub fn remote_get_gpg_verify_summary(&self, name: &str) -> Result<bool, glib::Error> {
unsafe {
let mut out_gpg_verify_summary = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
@ -615,7 +614,7 @@ impl Repo {
}
}
pub fn remote_get_url(&self, name: &str) -> Result<GString, Error> {
pub fn remote_get_url(&self, name: &str) -> Result<GString, glib::Error> {
unsafe {
let mut out_url = ptr::null_mut();
let mut error = ptr::null_mut();
@ -624,7 +623,7 @@ impl Repo {
}
}
pub fn remote_gpg_import<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(&self, name: &str, source_stream: Option<&P>, key_ids: &[&str], cancellable: Option<&Q>) -> Result<u32, Error> {
pub fn remote_gpg_import<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(&self, name: &str, source_stream: Option<&P>, key_ids: &[&str], cancellable: Option<&Q>) -> Result<u32, glib::Error> {
unsafe {
let mut out_imported = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
@ -643,16 +642,16 @@ impl Repo {
}
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//pub fn remote_list_collection_refs<P: IsA<gio::Cancellable>>(&self, remote_name: &str, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 1, id: 0 }/TypeId { ns_id: 0, id: 28 }, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn remote_list_collection_refs<P: IsA<gio::Cancellable>>(&self, remote_name: &str, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 1, id: 0 }/TypeId { ns_id: 0, id: 28 }, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_remote_list_collection_refs() }
//}
//pub fn remote_list_refs<P: IsA<gio::Cancellable>>(&self, remote_name: &str, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn remote_list_refs<P: IsA<gio::Cancellable>>(&self, remote_name: &str, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_remote_list_refs() }
//}
#[cfg(any(feature = "v2018_6", feature = "dox"))]
pub fn resolve_collection_ref<P: IsA<gio::Cancellable>>(&self, ref_: &CollectionRef, allow_noent: bool, flags: RepoResolveRevExtFlags, cancellable: Option<&P>) -> Result<Option<GString>, Error> {
pub fn resolve_collection_ref<P: IsA<gio::Cancellable>>(&self, ref_: &CollectionRef, allow_noent: bool, flags: RepoResolveRevExtFlags, cancellable: Option<&P>) -> Result<Option<GString>, glib::Error> {
unsafe {
let mut out_rev = ptr::null_mut();
let mut error = ptr::null_mut();
@ -662,7 +661,7 @@ impl Repo {
}
#[cfg(any(feature = "v2018_6", feature = "dox"))]
pub fn resolve_keyring_for_collection<P: IsA<gio::Cancellable>>(&self, collection_id: &str, cancellable: Option<&P>) -> Result<Remote, Error> {
pub fn resolve_keyring_for_collection<P: IsA<gio::Cancellable>>(&self, collection_id: &str, cancellable: Option<&P>) -> Result<Remote, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ostree_sys::ostree_repo_resolve_keyring_for_collection(self.to_glib_none().0, collection_id.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -670,7 +669,7 @@ impl Repo {
}
}
pub fn resolve_rev(&self, refspec: &str, allow_noent: bool) -> Result<GString, Error> {
pub fn resolve_rev(&self, refspec: &str, allow_noent: bool) -> Result<GString, glib::Error> {
unsafe {
let mut out_rev = ptr::null_mut();
let mut error = ptr::null_mut();
@ -680,7 +679,7 @@ impl Repo {
}
#[cfg(any(feature = "v2016_7", feature = "dox"))]
pub fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: RepoResolveRevExtFlags) -> Result<GString, Error> {
pub fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: RepoResolveRevExtFlags) -> Result<GString, glib::Error> {
unsafe {
let mut out_rev = ptr::null_mut();
let mut error = ptr::null_mut();
@ -689,7 +688,7 @@ impl Repo {
}
}
pub fn scan_hardlinks<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
pub fn scan_hardlinks<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_scan_hardlinks(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -698,7 +697,7 @@ impl Repo {
}
#[cfg(any(feature = "v2017_10", feature = "dox"))]
pub fn set_alias_ref_immediate<P: IsA<gio::Cancellable>>(&self, remote: Option<&str>, ref_: &str, target: Option<&str>, cancellable: Option<&P>) -> Result<(), Error> {
pub fn set_alias_ref_immediate<P: IsA<gio::Cancellable>>(&self, remote: Option<&str>, ref_: &str, target: Option<&str>, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_set_alias_ref_immediate(self.to_glib_none().0, remote.to_glib_none().0, ref_.to_glib_none().0, target.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -707,7 +706,7 @@ impl Repo {
}
#[cfg(any(feature = "v2016_5", feature = "dox"))]
pub fn set_cache_dir<P: IsA<gio::Cancellable>>(&self, dfd: i32, path: &str, cancellable: Option<&P>) -> Result<(), Error> {
pub fn set_cache_dir<P: IsA<gio::Cancellable>>(&self, dfd: i32, path: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_set_cache_dir(self.to_glib_none().0, dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -716,7 +715,7 @@ impl Repo {
}
#[cfg(any(feature = "v2018_6", feature = "dox"))]
pub fn set_collection_id(&self, collection_id: Option<&str>) -> Result<(), Error> {
pub fn set_collection_id(&self, collection_id: Option<&str>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_set_collection_id(self.to_glib_none().0, collection_id.to_glib_none().0, &mut error);
@ -725,7 +724,7 @@ impl Repo {
}
#[cfg(any(feature = "v2018_6", feature = "dox"))]
pub fn set_collection_ref_immediate<P: IsA<gio::Cancellable>>(&self, ref_: &CollectionRef, checksum: Option<&str>, cancellable: Option<&P>) -> Result<(), Error> {
pub fn set_collection_ref_immediate<P: IsA<gio::Cancellable>>(&self, ref_: &CollectionRef, checksum: Option<&str>, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_set_collection_ref_immediate(self.to_glib_none().0, ref_.to_glib_none().0, checksum.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -739,7 +738,7 @@ impl Repo {
}
}
pub fn set_ref_immediate<P: IsA<gio::Cancellable>>(&self, remote: Option<&str>, ref_: &str, checksum: Option<&str>, cancellable: Option<&P>) -> Result<(), Error> {
pub fn set_ref_immediate<P: IsA<gio::Cancellable>>(&self, remote: Option<&str>, ref_: &str, checksum: Option<&str>, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_set_ref_immediate(self.to_glib_none().0, remote.to_glib_none().0, ref_.to_glib_none().0, checksum.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -747,7 +746,7 @@ impl Repo {
}
}
pub fn sign_commit<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, key_id: &str, homedir: Option<&str>, cancellable: Option<&P>) -> Result<(), Error> {
pub fn sign_commit<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, key_id: &str, homedir: Option<&str>, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_sign_commit(self.to_glib_none().0, commit_checksum.to_glib_none().0, key_id.to_glib_none().0, homedir.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -755,7 +754,7 @@ impl Repo {
}
}
pub fn sign_delta<P: IsA<gio::Cancellable>>(&self, from_commit: &str, to_commit: &str, key_id: &str, homedir: &str, cancellable: Option<&P>) -> Result<(), Error> {
pub fn sign_delta<P: IsA<gio::Cancellable>>(&self, from_commit: &str, to_commit: &str, key_id: &str, homedir: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_sign_delta(self.to_glib_none().0, from_commit.to_glib_none().0, to_commit.to_glib_none().0, key_id.to_glib_none().0, homedir.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -763,7 +762,7 @@ impl Repo {
}
}
pub fn static_delta_execute_offline<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, dir_or_file: &P, skip_validation: bool, cancellable: Option<&Q>) -> Result<(), Error> {
pub fn static_delta_execute_offline<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, dir_or_file: &P, skip_validation: bool, cancellable: Option<&Q>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_static_delta_execute_offline(self.to_glib_none().0, dir_or_file.as_ref().to_glib_none().0, skip_validation.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -771,7 +770,7 @@ impl Repo {
}
}
pub fn static_delta_generate<P: IsA<gio::Cancellable>>(&self, opt: StaticDeltaGenerateOpt, from: &str, to: &str, metadata: Option<&glib::Variant>, params: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(), Error> {
pub fn static_delta_generate<P: IsA<gio::Cancellable>>(&self, opt: StaticDeltaGenerateOpt, from: &str, to: &str, metadata: Option<&glib::Variant>, params: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_static_delta_generate(self.to_glib_none().0, opt.to_glib(), from.to_glib_none().0, to.to_glib_none().0, metadata.to_glib_none().0, params.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -798,25 +797,25 @@ impl Repo {
}
}
//pub fn traverse_commit<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, maxdepth: i32, out_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 185 }/TypeId { ns_id: 2, id: 185 }, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn traverse_commit<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, maxdepth: i32, out_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 185 }/TypeId { ns_id: 2, id: 185 }, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_traverse_commit() }
//}
//pub fn traverse_commit_union<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, maxdepth: i32, inout_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn traverse_commit_union<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, maxdepth: i32, inout_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_traverse_commit_union() }
//}
//#[cfg(any(feature = "v2018_5", feature = "dox"))]
//pub fn traverse_commit_union_with_parents<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, maxdepth: i32, inout_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, inout_parents: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn traverse_commit_union_with_parents<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, maxdepth: i32, inout_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, inout_parents: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_traverse_commit_union_with_parents() }
//}
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//pub fn traverse_reachable_refs<P: IsA<gio::Cancellable>>(&self, depth: u32, reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 185 }/TypeId { ns_id: 2, id: 185 }, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn traverse_reachable_refs<P: IsA<gio::Cancellable>>(&self, depth: u32, reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 185 }/TypeId { ns_id: 2, id: 185 }, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_traverse_reachable_refs() }
//}
pub fn verify_commit<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(&self, commit_checksum: &str, keyringdir: Option<&P>, extra_keyring: Option<&Q>, cancellable: Option<&R>) -> Result<(), Error> {
pub fn verify_commit<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(&self, commit_checksum: &str, keyringdir: Option<&P>, extra_keyring: Option<&Q>, cancellable: Option<&R>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_verify_commit(self.to_glib_none().0, commit_checksum.to_glib_none().0, keyringdir.map(|p| p.as_ref()).to_glib_none().0, extra_keyring.map(|p| p.as_ref()).to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -824,7 +823,7 @@ impl Repo {
}
}
pub fn verify_commit_ext<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(&self, commit_checksum: &str, keyringdir: Option<&P>, extra_keyring: Option<&Q>, cancellable: Option<&R>) -> Result<GpgVerifyResult, Error> {
pub fn verify_commit_ext<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(&self, commit_checksum: &str, keyringdir: Option<&P>, extra_keyring: Option<&Q>, cancellable: Option<&R>) -> Result<GpgVerifyResult, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ostree_sys::ostree_repo_verify_commit_ext(self.to_glib_none().0, commit_checksum.to_glib_none().0, keyringdir.map(|p| p.as_ref()).to_glib_none().0, extra_keyring.map(|p| p.as_ref()).to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -833,7 +832,7 @@ impl Repo {
}
#[cfg(any(feature = "v2016_14", feature = "dox"))]
pub fn verify_commit_for_remote<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, remote_name: &str, cancellable: Option<&P>) -> Result<GpgVerifyResult, Error> {
pub fn verify_commit_for_remote<P: IsA<gio::Cancellable>>(&self, commit_checksum: &str, remote_name: &str, cancellable: Option<&P>) -> Result<GpgVerifyResult, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ostree_sys::ostree_repo_verify_commit_for_remote(self.to_glib_none().0, commit_checksum.to_glib_none().0, remote_name.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -841,7 +840,7 @@ impl Repo {
}
}
pub fn verify_summary<P: IsA<gio::Cancellable>>(&self, remote_name: &str, summary: &glib::Bytes, signatures: &glib::Bytes, cancellable: Option<&P>) -> Result<GpgVerifyResult, Error> {
pub fn verify_summary<P: IsA<gio::Cancellable>>(&self, remote_name: &str, summary: &glib::Bytes, signatures: &glib::Bytes, cancellable: Option<&P>) -> Result<GpgVerifyResult, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ostree_sys::ostree_repo_verify_summary(self.to_glib_none().0, remote_name.to_glib_none().0, summary.to_glib_none().0, signatures.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -849,7 +848,7 @@ impl Repo {
}
}
pub fn write_archive_to_mtree<P: IsA<gio::File>, Q: IsA<MutableTree>, R: IsA<gio::Cancellable>>(&self, archive: &P, mtree: &Q, modifier: Option<&RepoCommitModifier>, autocreate_parents: bool, cancellable: Option<&R>) -> Result<(), Error> {
pub fn write_archive_to_mtree<P: IsA<gio::File>, Q: IsA<MutableTree>, R: IsA<gio::Cancellable>>(&self, archive: &P, mtree: &Q, modifier: Option<&RepoCommitModifier>, autocreate_parents: bool, cancellable: Option<&R>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_write_archive_to_mtree(self.to_glib_none().0, archive.as_ref().to_glib_none().0, mtree.as_ref().to_glib_none().0, modifier.to_glib_none().0, autocreate_parents.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -857,7 +856,7 @@ impl Repo {
}
}
pub fn write_archive_to_mtree_from_fd<P: IsA<MutableTree>, Q: IsA<gio::Cancellable>>(&self, fd: i32, mtree: &P, modifier: Option<&RepoCommitModifier>, autocreate_parents: bool, cancellable: Option<&Q>) -> Result<(), Error> {
pub fn write_archive_to_mtree_from_fd<P: IsA<MutableTree>, Q: IsA<gio::Cancellable>>(&self, fd: i32, mtree: &P, modifier: Option<&RepoCommitModifier>, autocreate_parents: bool, cancellable: Option<&Q>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_write_archive_to_mtree_from_fd(self.to_glib_none().0, fd, mtree.as_ref().to_glib_none().0, modifier.to_glib_none().0, autocreate_parents.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -865,7 +864,7 @@ impl Repo {
}
}
pub fn write_commit<P: IsA<RepoFile>, Q: IsA<gio::Cancellable>>(&self, parent: Option<&str>, subject: Option<&str>, body: Option<&str>, metadata: Option<&glib::Variant>, root: &P, cancellable: Option<&Q>) -> Result<GString, Error> {
pub fn write_commit<P: IsA<RepoFile>, Q: IsA<gio::Cancellable>>(&self, parent: Option<&str>, subject: Option<&str>, body: Option<&str>, metadata: Option<&glib::Variant>, root: &P, cancellable: Option<&Q>) -> Result<GString, glib::Error> {
unsafe {
let mut out_commit = ptr::null_mut();
let mut error = ptr::null_mut();
@ -874,7 +873,7 @@ impl Repo {
}
}
pub fn write_commit_detached_metadata<P: IsA<gio::Cancellable>>(&self, checksum: &str, metadata: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(), Error> {
pub fn write_commit_detached_metadata<P: IsA<gio::Cancellable>>(&self, checksum: &str, metadata: Option<&glib::Variant>, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_write_commit_detached_metadata(self.to_glib_none().0, checksum.to_glib_none().0, metadata.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -882,7 +881,7 @@ impl Repo {
}
}
pub fn write_commit_with_time<P: IsA<RepoFile>, Q: IsA<gio::Cancellable>>(&self, parent: Option<&str>, subject: Option<&str>, body: Option<&str>, metadata: Option<&glib::Variant>, root: &P, time: u64, cancellable: Option<&Q>) -> Result<GString, Error> {
pub fn write_commit_with_time<P: IsA<RepoFile>, Q: IsA<gio::Cancellable>>(&self, parent: Option<&str>, subject: Option<&str>, body: Option<&str>, metadata: Option<&glib::Variant>, root: &P, time: u64, cancellable: Option<&Q>) -> Result<GString, glib::Error> {
unsafe {
let mut out_commit = ptr::null_mut();
let mut error = ptr::null_mut();
@ -891,7 +890,7 @@ impl Repo {
}
}
pub fn write_config(&self, new_config: &glib::KeyFile) -> Result<(), Error> {
pub fn write_config(&self, new_config: &glib::KeyFile) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_write_config(self.to_glib_none().0, new_config.to_glib_none().0, &mut error);
@ -899,11 +898,11 @@ impl Repo {
}
}
//pub fn write_content<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(&self, expected_checksum: Option<&str>, object_input: &P, length: u64, out_csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Option<&Q>) -> Result<(), Error> {
//pub fn write_content<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(&self, expected_checksum: Option<&str>, object_input: &P, length: u64, out_csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Option<&Q>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_write_content() }
//}
pub fn write_content_trusted<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(&self, checksum: &str, object_input: &P, length: u64, cancellable: Option<&Q>) -> Result<(), Error> {
pub fn write_content_trusted<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(&self, checksum: &str, object_input: &P, length: u64, cancellable: Option<&Q>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_write_content_trusted(self.to_glib_none().0, checksum.to_glib_none().0, object_input.as_ref().to_glib_none().0, length, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -911,7 +910,7 @@ impl Repo {
}
}
pub fn write_dfd_to_mtree<P: IsA<MutableTree>, Q: IsA<gio::Cancellable>>(&self, dfd: i32, path: &str, mtree: &P, modifier: Option<&RepoCommitModifier>, cancellable: Option<&Q>) -> Result<(), Error> {
pub fn write_dfd_to_mtree<P: IsA<MutableTree>, Q: IsA<gio::Cancellable>>(&self, dfd: i32, path: &str, mtree: &P, modifier: Option<&RepoCommitModifier>, cancellable: Option<&Q>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_write_dfd_to_mtree(self.to_glib_none().0, dfd, path.to_glib_none().0, mtree.as_ref().to_glib_none().0, modifier.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -919,7 +918,7 @@ impl Repo {
}
}
pub fn write_directory_to_mtree<P: IsA<gio::File>, Q: IsA<MutableTree>, R: IsA<gio::Cancellable>>(&self, dir: &P, mtree: &Q, modifier: Option<&RepoCommitModifier>, cancellable: Option<&R>) -> Result<(), Error> {
pub fn write_directory_to_mtree<P: IsA<gio::File>, Q: IsA<MutableTree>, R: IsA<gio::Cancellable>>(&self, dir: &P, mtree: &Q, modifier: Option<&RepoCommitModifier>, cancellable: Option<&R>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_write_directory_to_mtree(self.to_glib_none().0, dir.as_ref().to_glib_none().0, mtree.as_ref().to_glib_none().0, modifier.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -927,39 +926,36 @@ impl Repo {
}
}
//pub fn write_metadata<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, expected_checksum: Option<&str>, object: &glib::Variant, out_csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn write_metadata<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, expected_checksum: Option<&str>, object: &glib::Variant, out_csum: /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_repo_write_metadata() }
//}
//pub fn write_metadata_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result</*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, Error>) + Send + 'static>(&self, objtype: ObjectType, expected_checksum: Option<&str>, object: &glib::Variant, cancellable: Option<&P>, callback: Q) {
//pub fn write_metadata_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result</*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, glib::Error>) + Send + 'static>(&self, objtype: ObjectType, expected_checksum: Option<&str>, object: &glib::Variant, cancellable: Option<&P>, callback: Q) {
// unsafe { TODO: call ostree_sys:ostree_repo_write_metadata_async() }
//}
//#[cfg(feature = "futures")]
//pub fn write_metadata_async_future(&self, objtype: ObjectType, expected_checksum: Option<&str>, object: &glib::Variant) -> Box_<dyn future::Future<Output = Result</*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, Error>> + std::marker::Unpin> {
//use gio::GioFuture;
//use fragile::Fragile;
//
//pub fn write_metadata_async_future(&self, objtype: ObjectType, expected_checksum: Option<&str>, object: &glib::Variant) -> Pin<Box_<dyn std::future::Future<Output = Result</*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, glib::Error>> + 'static>> {
//let expected_checksum = expected_checksum.map(ToOwned::to_owned);
//let object = object.clone();
//GioFuture::new(self, move |obj, send| {
//Box_::pin(gio::GioFuture::new(self, move |obj, send| {
// let cancellable = gio::Cancellable::new();
// let send = Fragile::new(send);
// obj.write_metadata_async(
// objtype,
// expected_checksum.as_ref().map(::std::borrow::Borrow::borrow),
// &object,
// Some(&cancellable),
// move |res| {
// let _ = send.into_inner().send(res);
// send.resolve(res);
// },
// );
// cancellable
//})
//}))
//}
pub fn write_metadata_stream_trusted<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Option<&Q>) -> Result<(), Error> {
pub fn write_metadata_stream_trusted<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Option<&Q>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_write_metadata_stream_trusted(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, object_input.as_ref().to_glib_none().0, length, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -967,7 +963,7 @@ impl Repo {
}
}
pub fn write_metadata_trusted<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, checksum: &str, variant: &glib::Variant, cancellable: Option<&P>) -> Result<(), Error> {
pub fn write_metadata_trusted<P: IsA<gio::Cancellable>>(&self, objtype: ObjectType, checksum: &str, variant: &glib::Variant, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_write_metadata_trusted(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, variant.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -975,7 +971,7 @@ impl Repo {
}
}
pub fn write_mtree<P: IsA<MutableTree>, Q: IsA<gio::Cancellable>>(&self, mtree: &P, cancellable: Option<&Q>) -> Result<gio::File, Error> {
pub fn write_mtree<P: IsA<MutableTree>, Q: IsA<gio::Cancellable>>(&self, mtree: &P, cancellable: Option<&Q>) -> Result<gio::File, glib::Error> {
unsafe {
let mut out_file = ptr::null_mut();
let mut error = ptr::null_mut();
@ -988,7 +984,7 @@ impl Repo {
unsafe {
let mut value = Value::from_type(<GString as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"remotes-config-dir\0".as_ptr() as *const _, value.to_glib_none_mut().0);
value.get()
value.get().expect("Return Value for property `remotes-config-dir` getter")
}
}
@ -996,12 +992,12 @@ impl Repo {
unsafe {
let mut value = Value::from_type(<gio::File as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"sysroot-path\0".as_ptr() as *const _, value.to_glib_none_mut().0);
value.get()
value.get().expect("Return Value for property `sysroot-path` getter")
}
}
#[cfg(any(feature = "v2017_10", feature = "dox"))]
pub fn create_at<P: IsA<gio::Cancellable>>(dfd: i32, path: &str, mode: RepoMode, options: &glib::Variant, cancellable: Option<&P>) -> Result<Repo, Error> {
pub fn create_at<P: IsA<gio::Cancellable>>(dfd: i32, path: &str, mode: RepoMode, options: &glib::Variant, cancellable: Option<&P>) -> Result<Repo, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ostree_sys::ostree_repo_create_at(dfd, path.to_glib_none().0, mode.to_glib(), options.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -1009,7 +1005,7 @@ impl Repo {
}
}
pub fn mode_from_string(mode: &str) -> Result<RepoMode, Error> {
pub fn mode_from_string(mode: &str) -> Result<RepoMode, glib::Error> {
unsafe {
let mut out_mode = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
@ -1020,7 +1016,7 @@ impl Repo {
}
#[cfg(any(feature = "v2017_10", feature = "dox"))]
pub fn open_at<P: IsA<gio::Cancellable>>(dfd: i32, path: &str, cancellable: Option<&P>) -> Result<Repo, Error> {
pub fn open_at<P: IsA<gio::Cancellable>>(dfd: i32, path: &str, cancellable: Option<&P>) -> Result<Repo, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ostree_sys::ostree_repo_open_at(dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);

View File

@ -2,18 +2,18 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use gio;
use glib;
use glib::translate::*;
use glib::GString;
use ostree_sys;
use std::boxed::Box as Box_;
use Repo;
use RepoCommitFilterResult;
use RepoCommitModifierFlags;
#[cfg(any(feature = "v2017_13", feature = "dox"))]
use RepoDevInoCache;
use SePolicy;
use gio;
use glib;
use glib::GString;
use glib::translate::*;
use ostree_sys;
use std::boxed::Box as Box_;
glib_wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
@ -27,13 +27,13 @@ glib_wrapper! {
}
impl RepoCommitModifier {
pub fn new(flags: RepoCommitModifierFlags, commit_filter: Option<Box<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>) -> RepoCommitModifier {
let commit_filter_data: Box_<Option<Box<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>> = Box::new(commit_filter);
pub fn new(flags: RepoCommitModifierFlags, commit_filter: Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>) -> RepoCommitModifier {
let commit_filter_data: Box_<Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>> = Box_::new(commit_filter);
unsafe extern "C" fn commit_filter_func(repo: *mut ostree_sys::OstreeRepo, path: *const libc::c_char, file_info: *mut gio_sys::GFileInfo, user_data: glib_sys::gpointer) -> ostree_sys::OstreeRepoCommitFilterResult {
let repo = from_glib_borrow(repo);
let path: GString = from_glib_borrow(path);
let file_info = from_glib_borrow(file_info);
let callback: &Option<Box<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>> = &*(user_data as *mut _);
let callback: &Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>> = &*(user_data as *mut _);
let res = if let Some(ref callback) = *callback {
callback(&repo, path.as_str(), &file_info)
} else {
@ -43,12 +43,12 @@ impl RepoCommitModifier {
}
let commit_filter = if commit_filter_data.is_some() { Some(commit_filter_func as _) } else { None };
unsafe extern "C" fn destroy_notify_func(data: glib_sys::gpointer) {
let _callback: Box_<Option<Box<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>> = Box_::from_raw(data as *mut _);
let _callback: Box_<Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>> = Box_::from_raw(data as *mut _);
}
let destroy_call3 = Some(destroy_notify_func as _);
let super_callback0: Box_<Option<Box<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>> = commit_filter_data;
let super_callback0: Box_<Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>> = commit_filter_data;
unsafe {
from_glib_full(ostree_sys::ostree_repo_commit_modifier_new(flags.to_glib(), commit_filter, Box::into_raw(super_callback0) as *mut _, destroy_call3))
from_glib_full(ostree_sys::ostree_repo_commit_modifier_new(flags.to_glib(), commit_filter, Box_::into_raw(super_callback0) as *mut _, destroy_call3))
}
}
@ -66,7 +66,7 @@ impl RepoCommitModifier {
}
pub fn set_xattr_callback<P: Fn(&Repo, &str, &gio::FileInfo) -> glib::Variant + 'static>(&self, callback: P) {
let callback_data: Box_<P> = Box::new(callback);
let callback_data: Box_<P> = Box_::new(callback);
unsafe extern "C" fn callback_func<P: Fn(&Repo, &str, &gio::FileInfo) -> glib::Variant + 'static>(repo: *mut ostree_sys::OstreeRepo, path: *const libc::c_char, file_info: *mut gio_sys::GFileInfo, user_data: glib_sys::gpointer) -> *mut glib_sys::GVariant {
let repo = from_glib_borrow(repo);
let path: GString = from_glib_borrow(path);
@ -82,7 +82,7 @@ impl RepoCommitModifier {
let destroy_call2 = Some(destroy_func::<P> as _);
let super_callback0: Box_<P> = callback_data;
unsafe {
ostree_sys::ostree_repo_commit_modifier_set_xattr_callback(self.to_glib_none().0, callback, destroy_call2, Box::into_raw(super_callback0) as *mut _);
ostree_sys::ostree_repo_commit_modifier_set_xattr_callback(self.to_glib_none().0, callback, destroy_call2, Box_::into_raw(super_callback0) as *mut _);
}
}
}

View File

@ -2,17 +2,16 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Error;
use Repo;
use gio;
use glib;
use glib::GString;
use glib::object::IsA;
use glib::translate::*;
use glib::GString;
use ostree_sys;
use std::fmt;
use std::mem;
use std::ptr;
use Repo;
glib_wrapper! {
pub struct RepoFile(Object<ostree_sys::OstreeRepoFile, ostree_sys::OstreeRepoFileClass, RepoFileClass>) @implements gio::File;
@ -25,7 +24,7 @@ glib_wrapper! {
pub const NONE_REPO_FILE: Option<&RepoFile> = None;
pub trait RepoFileExt: 'static {
fn ensure_resolved(&self) -> Result<(), Error>;
fn ensure_resolved(&self) -> Result<(), glib::Error>;
fn get_checksum(&self) -> Option<GString>;
@ -33,7 +32,7 @@ pub trait RepoFileExt: 'static {
fn get_root(&self) -> Option<RepoFile>;
fn get_xattrs<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<glib::Variant, Error>;
fn get_xattrs<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<glib::Variant, glib::Error>;
fn tree_find_child(&self, name: &str) -> (i32, bool, glib::Variant);
@ -45,13 +44,13 @@ pub trait RepoFileExt: 'static {
fn tree_get_metadata_checksum(&self) -> Option<GString>;
fn tree_query_child<P: IsA<gio::Cancellable>>(&self, n: i32, attributes: &str, flags: gio::FileQueryInfoFlags, cancellable: Option<&P>) -> Result<gio::FileInfo, Error>;
fn tree_query_child<P: IsA<gio::Cancellable>>(&self, n: i32, attributes: &str, flags: gio::FileQueryInfoFlags, cancellable: Option<&P>) -> Result<gio::FileInfo, glib::Error>;
fn tree_set_metadata(&self, checksum: &str, metadata: &glib::Variant);
}
impl<O: IsA<RepoFile>> RepoFileExt for O {
fn ensure_resolved(&self) -> Result<(), Error> {
fn ensure_resolved(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_file_ensure_resolved(self.as_ref().to_glib_none().0, &mut error);
@ -77,7 +76,7 @@ impl<O: IsA<RepoFile>> RepoFileExt for O {
}
}
fn get_xattrs<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<glib::Variant, Error> {
fn get_xattrs<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<glib::Variant, glib::Error> {
unsafe {
let mut out_xattrs = ptr::null_mut();
let mut error = ptr::null_mut();
@ -120,7 +119,7 @@ impl<O: IsA<RepoFile>> RepoFileExt for O {
}
}
fn tree_query_child<P: IsA<gio::Cancellable>>(&self, n: i32, attributes: &str, flags: gio::FileQueryInfoFlags, cancellable: Option<&P>) -> Result<gio::FileInfo, Error> {
fn tree_query_child<P: IsA<gio::Cancellable>>(&self, n: i32, attributes: &str, flags: gio::FileQueryInfoFlags, cancellable: Option<&P>) -> Result<gio::FileInfo, glib::Error> {
unsafe {
let mut out_info = ptr::null_mut();
let mut error = ptr::null_mut();

View File

@ -17,34 +17,31 @@ glib_wrapper! {
impl RepoFinder {
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//pub fn resolve_all_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, Error>) + Send + 'static>(finders: &[RepoFinder], refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q) {
//pub fn resolve_all_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, glib::Error>) + Send + 'static>(finders: &[RepoFinder], refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q) {
// unsafe { TODO: call ostree_sys:ostree_repo_finder_resolve_all_async() }
//}
//#[cfg(feature = "futures")]
//
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//pub fn resolve_all_async_future(finders: &[RepoFinder], refs: &[&CollectionRef], parent_repo: &Repo) -> Box_<dyn future::Future<Output = Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, Error>> + std::marker::Unpin> {
//use gio::GioFuture;
//use fragile::Fragile;
//pub fn resolve_all_async_future(finders: &[RepoFinder], refs: &[&CollectionRef], parent_repo: &Repo) -> Pin<Box_<dyn std::future::Future<Output = Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, glib::Error>> + 'static>> {
//let finders = finders.clone();
//let refs = refs.clone();
//let parent_repo = parent_repo.clone();
//GioFuture::new(&(), move |_obj, send| {
//Box_::pin(gio::GioFuture::new(&(), move |_obj, send| {
// let cancellable = gio::Cancellable::new();
// let send = Fragile::new(send);
// Self::resolve_all_async(
// &finders,
// &refs,
// &parent_repo,
// Some(&cancellable),
// move |res| {
// let _ = send.into_inner().send(res);
// send.resolve(res);
// },
// );
// cancellable
//})
//}))
//}
}
@ -52,41 +49,38 @@ pub const NONE_REPO_FINDER: Option<&RepoFinder> = None;
pub trait RepoFinderExt: 'static {
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//fn resolve_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, Error>) + Send + 'static>(&self, refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q);
//fn resolve_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, glib::Error>) + Send + 'static>(&self, refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q);
//#[cfg(feature = "futures")]
//
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//fn resolve_async_future(&self, refs: &[&CollectionRef], parent_repo: &Repo) -> Box_<dyn future::Future<Output = Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, Error>> + std::marker::Unpin>;
//fn resolve_async_future(&self, refs: &[&CollectionRef], parent_repo: &Repo) -> Pin<Box_<dyn std::future::Future<Output = Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, glib::Error>> + 'static>>;
}
impl<O: IsA<RepoFinder>> RepoFinderExt for O {
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//fn resolve_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, Error>) + Send + 'static>(&self, refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q) {
//fn resolve_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, glib::Error>) + Send + 'static>(&self, refs: &[&CollectionRef], parent_repo: &Repo, cancellable: Option<&P>, callback: Q) {
// unsafe { TODO: call ostree_sys:ostree_repo_finder_resolve_async() }
//}
//#[cfg(feature = "futures")]
//
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//fn resolve_async_future(&self, refs: &[&CollectionRef], parent_repo: &Repo) -> Box_<dyn future::Future<Output = Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, Error>> + std::marker::Unpin> {
//use gio::GioFuture;
//use fragile::Fragile;
//fn resolve_async_future(&self, refs: &[&CollectionRef], parent_repo: &Repo) -> Pin<Box_<dyn std::future::Future<Output = Result</*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 2 }, glib::Error>> + 'static>> {
//let refs = refs.clone();
//let parent_repo = parent_repo.clone();
//GioFuture::new(self, move |obj, send| {
//Box_::pin(gio::GioFuture::new(self, move |obj, send| {
// let cancellable = gio::Cancellable::new();
// let send = Fragile::new(send);
// obj.resolve_async(
// &refs,
// &parent_repo,
// Some(&cancellable),
// move |res| {
// let _ = send.into_inner().send(res);
// send.resolve(res);
// },
// );
// cancellable
//})
//}))
//}
}

View File

@ -2,9 +2,6 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
#[cfg(any(feature = "v2018_6", feature = "dox"))]
use Error;
use RepoFinder;
use glib;
use glib::object::IsA;
use glib::translate::*;
@ -12,6 +9,7 @@ use ostree_sys;
use std::fmt;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
use std::ptr;
use RepoFinder;
glib_wrapper! {
pub struct RepoFinderAvahi(Object<ostree_sys::OstreeRepoFinderAvahi, ostree_sys::OstreeRepoFinderAvahiClass, RepoFinderAvahiClass>) @implements RepoFinder;
@ -33,7 +31,7 @@ pub const NONE_REPO_FINDER_AVAHI: Option<&RepoFinderAvahi> = None;
pub trait RepoFinderAvahiExt: 'static {
#[cfg(any(feature = "v2018_6", feature = "dox"))]
fn start(&self) -> Result<(), Error>;
fn start(&self) -> Result<(), glib::Error>;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
fn stop(&self);
@ -41,7 +39,7 @@ pub trait RepoFinderAvahiExt: 'static {
impl<O: IsA<RepoFinderAvahi>> RepoFinderAvahiExt for O {
#[cfg(any(feature = "v2018_6", feature = "dox"))]
fn start(&self) -> Result<(), Error> {
fn start(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_repo_finder_avahi_start(self.as_ref().to_glib_none().0, &mut error);

View File

@ -2,10 +2,10 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use RepoFinder;
use glib::translate::*;
use ostree_sys;
use std::fmt;
use RepoFinder;
glib_wrapper! {
pub struct RepoFinderConfig(Object<ostree_sys::OstreeRepoFinderConfig, ostree_sys::OstreeRepoFinderConfigClass, RepoFinderConfigClass>) @implements RepoFinder;

View File

@ -2,19 +2,19 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use RepoFinder;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
use gio;
use glib::object::IsA;
use glib::translate::*;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
use glib::StaticType;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
use glib::Value;
use glib::object::IsA;
use glib::translate::*;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
use gobject_sys;
use ostree_sys;
use std::fmt;
use RepoFinder;
glib_wrapper! {
pub struct RepoFinderMount(Object<ostree_sys::OstreeRepoFinderMount, ostree_sys::OstreeRepoFinderMountClass, RepoFinderMountClass>) @implements RepoFinder;
@ -46,7 +46,7 @@ impl<O: IsA<RepoFinderMount>> RepoFinderMountExt for O {
unsafe {
let mut value = Value::from_type(<gio::VolumeMonitor as StaticType>::static_type());
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"monitor\0".as_ptr() as *const _, value.to_glib_none_mut().0);
value.get()
value.get().expect("Return Value for property `monitor` getter")
}
}
}

View File

@ -2,11 +2,11 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use RepoFinder;
use glib::object::IsA;
use glib::translate::*;
use ostree_sys;
use std::fmt;
use RepoFinder;
glib_wrapper! {
pub struct RepoFinderOverride(Object<ostree_sys::OstreeRepoFinderOverride, ostree_sys::OstreeRepoFinderOverrideClass, RepoFinderOverrideClass>) @implements RepoFinder;

View File

@ -2,19 +2,19 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Error;
use SePolicyRestoreconFlags;
use gio;
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::translate::*;
use glib::GString;
use glib::StaticType;
use glib::Value;
use gobject_sys;
use ostree_sys;
use std::fmt;
use std::ptr;
use SePolicyRestoreconFlags;
glib_wrapper! {
pub struct SePolicy(Object<ostree_sys::OstreeSePolicy, SePolicyClass>);
@ -25,7 +25,7 @@ glib_wrapper! {
}
impl SePolicy {
pub fn new<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(path: &P, cancellable: Option<&Q>) -> Result<SePolicy, Error> {
pub fn new<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(path: &P, cancellable: Option<&Q>) -> Result<SePolicy, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ostree_sys::ostree_sepolicy_new(path.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -34,7 +34,7 @@ impl SePolicy {
}
#[cfg(any(feature = "v2017_4", feature = "dox"))]
pub fn new_at<P: IsA<gio::Cancellable>>(rootfs_dfd: i32, cancellable: Option<&P>) -> Result<SePolicy, Error> {
pub fn new_at<P: IsA<gio::Cancellable>>(rootfs_dfd: i32, cancellable: Option<&P>) -> Result<SePolicy, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ostree_sys::ostree_sepolicy_new_at(rootfs_dfd, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -49,7 +49,7 @@ impl SePolicy {
}
}
pub fn get_label<P: IsA<gio::Cancellable>>(&self, relpath: &str, unix_mode: u32, cancellable: Option<&P>) -> Result<GString, Error> {
pub fn get_label<P: IsA<gio::Cancellable>>(&self, relpath: &str, unix_mode: u32, cancellable: Option<&P>) -> Result<GString, glib::Error> {
unsafe {
let mut out_label = ptr::null_mut();
let mut error = ptr::null_mut();
@ -70,7 +70,7 @@ impl SePolicy {
}
}
pub fn restorecon<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, path: &str, info: Option<&gio::FileInfo>, target: &P, flags: SePolicyRestoreconFlags, cancellable: Option<&Q>) -> Result<GString, Error> {
pub fn restorecon<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, path: &str, info: Option<&gio::FileInfo>, target: &P, flags: SePolicyRestoreconFlags, cancellable: Option<&Q>) -> Result<GString, glib::Error> {
unsafe {
let mut out_new_label = ptr::null_mut();
let mut error = ptr::null_mut();
@ -79,7 +79,7 @@ impl SePolicy {
}
}
pub fn setfscreatecon(&self, path: &str, mode: u32) -> Result<(), Error> {
pub fn setfscreatecon(&self, path: &str, mode: u32) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sepolicy_setfscreatecon(self.to_glib_none().0, path.to_glib_none().0, mode, &mut error);
@ -91,7 +91,7 @@ impl SePolicy {
unsafe {
let mut value = Value::from_type(<i32 as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"rootfs-dfd\0".as_ptr() as *const _, value.to_glib_none_mut().0);
value.get().unwrap()
value.get().expect("Return Value for property `rootfs-dfd` getter").unwrap()
}
}

View File

@ -2,26 +2,18 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use Deployment;
#[cfg(any(feature = "v2016_4", feature = "dox"))]
use DeploymentUnlockedState;
use Error;
use Repo;
use SysrootSimpleWriteDeploymentFlags;
#[cfg(feature = "futures")]
use futures::future;
use gio;
use gio_sys;
use glib;
use glib::GString;
use glib::object::IsA;
#[cfg(any(feature = "v2017_10", feature = "dox"))]
use glib::object::ObjectType as ObjectType_;
#[cfg(any(feature = "v2017_10", feature = "dox"))]
use glib::signal::SignalHandlerId;
#[cfg(any(feature = "v2017_10", feature = "dox"))]
use glib::signal::connect_raw;
#[cfg(any(feature = "v2017_10", feature = "dox"))]
use glib::signal::SignalHandlerId;
use glib::translate::*;
use glib::GString;
use glib_sys;
use gobject_sys;
#[cfg(any(feature = "v2017_10", feature = "dox"))]
@ -32,7 +24,13 @@ use std::fmt;
use std::mem;
#[cfg(any(feature = "v2017_10", feature = "dox"))]
use std::mem::transmute;
use std::pin::Pin;
use std::ptr;
use Deployment;
#[cfg(any(feature = "v2016_4", feature = "dox"))]
use DeploymentUnlockedState;
use Repo;
use SysrootSimpleWriteDeploymentFlags;
glib_wrapper! {
pub struct Sysroot(Object<ostree_sys::OstreeSysroot, SysrootClass>);
@ -55,7 +53,7 @@ impl Sysroot {
}
}
pub fn cleanup<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
pub fn cleanup<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_cleanup(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -64,11 +62,11 @@ impl Sysroot {
}
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
//pub fn cleanup_prune_repo<P: IsA<gio::Cancellable>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: Option<&P>) -> Result<(i32, i32, u64), Error> {
//pub fn cleanup_prune_repo<P: IsA<gio::Cancellable>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: Option<&P>) -> Result<(i32, i32, u64), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_sysroot_cleanup_prune_repo() }
//}
pub fn deploy_tree<P: IsA<gio::Cancellable>>(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, provided_merge_deployment: Option<&Deployment>, override_kernel_argv: &[&str], cancellable: Option<&P>) -> Result<Deployment, Error> {
pub fn deploy_tree<P: IsA<gio::Cancellable>>(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, provided_merge_deployment: Option<&Deployment>, override_kernel_argv: &[&str], cancellable: Option<&P>) -> Result<Deployment, glib::Error> {
unsafe {
let mut out_new_deployment = ptr::null_mut();
let mut error = ptr::null_mut();
@ -77,7 +75,7 @@ impl Sysroot {
}
}
pub fn deployment_set_kargs<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, new_kargs: &[&str], cancellable: Option<&P>) -> Result<(), Error> {
pub fn deployment_set_kargs<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, new_kargs: &[&str], cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_deployment_set_kargs(self.to_glib_none().0, deployment.to_glib_none().0, new_kargs.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -85,7 +83,7 @@ impl Sysroot {
}
}
pub fn deployment_set_mutable<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, is_mutable: bool, cancellable: Option<&P>) -> Result<(), Error> {
pub fn deployment_set_mutable<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, is_mutable: bool, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_deployment_set_mutable(self.to_glib_none().0, deployment.to_glib_none().0, is_mutable.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -94,7 +92,7 @@ impl Sysroot {
}
#[cfg(any(feature = "v2018_3", feature = "dox"))]
pub fn deployment_set_pinned(&self, deployment: &Deployment, is_pinned: bool) -> Result<(), Error> {
pub fn deployment_set_pinned(&self, deployment: &Deployment, is_pinned: bool) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_deployment_set_pinned(self.to_glib_none().0, deployment.to_glib_none().0, is_pinned.to_glib(), &mut error);
@ -103,7 +101,7 @@ impl Sysroot {
}
#[cfg(any(feature = "v2016_4", feature = "dox"))]
pub fn deployment_unlock<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, unlocked_state: DeploymentUnlockedState, cancellable: Option<&P>) -> Result<(), Error> {
pub fn deployment_unlock<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, unlocked_state: DeploymentUnlockedState, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_deployment_unlock(self.to_glib_none().0, deployment.to_glib_none().0, unlocked_state.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -111,7 +109,7 @@ impl Sysroot {
}
}
pub fn ensure_initialized<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
pub fn ensure_initialized<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_ensure_initialized(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -165,7 +163,7 @@ impl Sysroot {
}
}
pub fn get_repo<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<Repo, Error> {
pub fn get_repo<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<Repo, glib::Error> {
unsafe {
let mut out_repo = ptr::null_mut();
let mut error = ptr::null_mut();
@ -188,7 +186,7 @@ impl Sysroot {
}
#[cfg(any(feature = "v2016_4", feature = "dox"))]
pub fn init_osname<P: IsA<gio::Cancellable>>(&self, osname: &str, cancellable: Option<&P>) -> Result<(), Error> {
pub fn init_osname<P: IsA<gio::Cancellable>>(&self, osname: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_init_osname(self.to_glib_none().0, osname.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -196,7 +194,7 @@ impl Sysroot {
}
}
pub fn load<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
pub fn load<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_load(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -205,7 +203,7 @@ impl Sysroot {
}
#[cfg(any(feature = "v2016_4", feature = "dox"))]
pub fn load_if_changed<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<bool, Error> {
pub fn load_if_changed<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<bool, glib::Error> {
unsafe {
let mut out_changed = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
@ -215,7 +213,7 @@ impl Sysroot {
}
}
pub fn lock(&self) -> Result<(), Error> {
pub fn lock(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_lock(self.to_glib_none().0, &mut error);
@ -223,38 +221,35 @@ impl Sysroot {
}
}
pub fn lock_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result<(), Error>) + Send + 'static>(&self, cancellable: Option<&P>, callback: Q) {
let user_data: Box<Q> = Box::new(callback);
unsafe extern "C" fn lock_async_trampoline<Q: FnOnce(Result<(), Error>) + Send + 'static>(_source_object: *mut gobject_sys::GObject, res: *mut gio_sys::GAsyncResult, user_data: glib_sys::gpointer) {
pub fn lock_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result<(), glib::Error>) + Send + 'static>(&self, cancellable: Option<&P>, callback: Q) {
let user_data: Box_<Q> = Box_::new(callback);
unsafe extern "C" fn lock_async_trampoline<Q: FnOnce(Result<(), glib::Error>) + Send + 'static>(_source_object: *mut gobject_sys::GObject, res: *mut gio_sys::GAsyncResult, user_data: glib_sys::gpointer) {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_lock_finish(_source_object as *mut _, res, &mut error);
let result = if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) };
let callback: Box<Q> = Box::from_raw(user_data as *mut _);
let callback: Box_<Q> = Box_::from_raw(user_data as *mut _);
callback(result);
}
let callback = lock_async_trampoline::<Q>;
unsafe {
ostree_sys::ostree_sysroot_lock_async(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, Some(callback), Box::into_raw(user_data) as *mut _);
ostree_sys::ostree_sysroot_lock_async(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, Some(callback), Box_::into_raw(user_data) as *mut _);
}
}
#[cfg(feature = "futures")]
pub fn lock_async_future(&self) -> Box_<dyn future::Future<Output = Result<(), Error>> + std::marker::Unpin> {
use gio::GioFuture;
use fragile::Fragile;
pub fn lock_async_future(&self) -> Pin<Box_<dyn std::future::Future<Output = Result<(), glib::Error>> + 'static>> {
GioFuture::new(self, move |obj, send| {
Box_::pin(gio::GioFuture::new(self, move |obj, send| {
let cancellable = gio::Cancellable::new();
let send = Fragile::new(send);
obj.lock_async(
Some(&cancellable),
move |res| {
let _ = send.into_inner().send(res);
send.resolve(res);
},
);
cancellable
})
}))
}
pub fn origin_new_from_refspec(&self, refspec: &str) -> Option<glib::KeyFile> {
@ -263,7 +258,7 @@ impl Sysroot {
}
}
pub fn prepare_cleanup<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
pub fn prepare_cleanup<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_prepare_cleanup(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -288,7 +283,7 @@ impl Sysroot {
}
}
pub fn simple_write_deployment<P: IsA<gio::Cancellable>>(&self, osname: Option<&str>, new_deployment: &Deployment, merge_deployment: Option<&Deployment>, flags: SysrootSimpleWriteDeploymentFlags, cancellable: Option<&P>) -> Result<(), Error> {
pub fn simple_write_deployment<P: IsA<gio::Cancellable>>(&self, osname: Option<&str>, new_deployment: &Deployment, merge_deployment: Option<&Deployment>, flags: SysrootSimpleWriteDeploymentFlags, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_simple_write_deployment(self.to_glib_none().0, osname.to_glib_none().0, new_deployment.to_glib_none().0, merge_deployment.to_glib_none().0, flags.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -297,7 +292,7 @@ impl Sysroot {
}
#[cfg(any(feature = "v2018_5", feature = "dox"))]
pub fn stage_tree<P: IsA<gio::Cancellable>>(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, merge_deployment: Option<&Deployment>, override_kernel_argv: &[&str], cancellable: Option<&P>) -> Result<Deployment, Error> {
pub fn stage_tree<P: IsA<gio::Cancellable>>(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, merge_deployment: Option<&Deployment>, override_kernel_argv: &[&str], cancellable: Option<&P>) -> Result<Deployment, glib::Error> {
unsafe {
let mut out_new_deployment = ptr::null_mut();
let mut error = ptr::null_mut();
@ -306,7 +301,7 @@ impl Sysroot {
}
}
pub fn try_lock(&self) -> Result<bool, Error> {
pub fn try_lock(&self) -> Result<bool, glib::Error> {
unsafe {
let mut out_acquired = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
@ -328,16 +323,16 @@ impl Sysroot {
}
}
//pub fn write_deployments<P: IsA<gio::Cancellable>>(&self, new_deployments: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 20 }, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn write_deployments<P: IsA<gio::Cancellable>>(&self, new_deployments: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 20 }, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_sysroot_write_deployments() }
//}
//#[cfg(any(feature = "v2017_4", feature = "dox"))]
//pub fn write_deployments_with_options<P: IsA<gio::Cancellable>>(&self, new_deployments: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 20 }, opts: /*Ignored*/&mut SysrootWriteDeploymentsOpts, cancellable: Option<&P>) -> Result<(), Error> {
//pub fn write_deployments_with_options<P: IsA<gio::Cancellable>>(&self, new_deployments: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 1, id: 20 }, opts: /*Ignored*/&mut SysrootWriteDeploymentsOpts, cancellable: Option<&P>) -> Result<(), glib::Error> {
// unsafe { TODO: call ostree_sys:ostree_sysroot_write_deployments_with_options() }
//}
pub fn write_origin_file<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, new_origin: Option<&glib::KeyFile>, cancellable: Option<&P>) -> Result<(), Error> {
pub fn write_origin_file<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, new_origin: Option<&glib::KeyFile>, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_write_origin_file(self.to_glib_none().0, deployment.to_glib_none().0, new_origin.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);

View File

@ -2,26 +2,25 @@
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
use AsyncProgress;
use Error;
use Repo;
use RepoPullFlags;
use Sysroot;
use SysrootUpgraderFlags;
use SysrootUpgraderPullFlags;
use gio;
use glib;
use glib::GString;
use glib::StaticType;
use glib::Value;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::translate::*;
use glib::GString;
use glib::StaticType;
use glib::Value;
use gobject_sys;
use ostree_sys;
use std::fmt;
use std::mem;
use std::ptr;
use AsyncProgress;
use Repo;
use RepoPullFlags;
use Sysroot;
use SysrootUpgraderFlags;
use SysrootUpgraderPullFlags;
glib_wrapper! {
pub struct SysrootUpgrader(Object<ostree_sys::OstreeSysrootUpgrader, SysrootUpgraderClass>);
@ -32,7 +31,7 @@ glib_wrapper! {
}
impl SysrootUpgrader {
pub fn new<P: IsA<gio::Cancellable>>(sysroot: &Sysroot, cancellable: Option<&P>) -> Result<SysrootUpgrader, Error> {
pub fn new<P: IsA<gio::Cancellable>>(sysroot: &Sysroot, cancellable: Option<&P>) -> Result<SysrootUpgrader, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ostree_sys::ostree_sysroot_upgrader_new(sysroot.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -40,7 +39,7 @@ impl SysrootUpgrader {
}
}
pub fn new_for_os<P: IsA<gio::Cancellable>>(sysroot: &Sysroot, osname: Option<&str>, cancellable: Option<&P>) -> Result<SysrootUpgrader, Error> {
pub fn new_for_os<P: IsA<gio::Cancellable>>(sysroot: &Sysroot, osname: Option<&str>, cancellable: Option<&P>) -> Result<SysrootUpgrader, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ostree_sys::ostree_sysroot_upgrader_new_for_os(sysroot.to_glib_none().0, osname.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -48,7 +47,7 @@ impl SysrootUpgrader {
}
}
pub fn new_for_os_with_flags<P: IsA<gio::Cancellable>>(sysroot: &Sysroot, osname: Option<&str>, flags: SysrootUpgraderFlags, cancellable: Option<&P>) -> Result<SysrootUpgrader, Error> {
pub fn new_for_os_with_flags<P: IsA<gio::Cancellable>>(sysroot: &Sysroot, osname: Option<&str>, flags: SysrootUpgraderFlags, cancellable: Option<&P>) -> Result<SysrootUpgrader, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ostree_sys::ostree_sysroot_upgrader_new_for_os_with_flags(sysroot.to_glib_none().0, osname.to_glib_none().0, flags.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -56,7 +55,7 @@ impl SysrootUpgrader {
}
}
pub fn deploy<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), Error> {
pub fn deploy<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_upgrader_deploy(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -82,7 +81,7 @@ impl SysrootUpgrader {
}
}
pub fn pull<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<bool, Error> {
pub fn pull<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<bool, glib::Error> {
unsafe {
let mut out_changed = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
@ -92,7 +91,7 @@ impl SysrootUpgrader {
}
}
pub fn pull_one_dir<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, dir_to_pull: &str, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<bool, Error> {
pub fn pull_one_dir<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, dir_to_pull: &str, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<bool, glib::Error> {
unsafe {
let mut out_changed = mem::MaybeUninit::uninit();
let mut error = ptr::null_mut();
@ -102,7 +101,7 @@ impl SysrootUpgrader {
}
}
pub fn set_origin<P: IsA<gio::Cancellable>>(&self, origin: Option<&glib::KeyFile>, cancellable: Option<&P>) -> Result<(), Error> {
pub fn set_origin<P: IsA<gio::Cancellable>>(&self, origin: Option<&glib::KeyFile>, cancellable: Option<&P>) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_upgrader_set_origin(self.to_glib_none().0, origin.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
@ -114,7 +113,7 @@ impl SysrootUpgrader {
unsafe {
let mut value = Value::from_type(<SysrootUpgraderFlags as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"flags\0".as_ptr() as *const _, value.to_glib_none_mut().0);
value.get().unwrap()
value.get().expect("Return Value for property `flags` getter").unwrap()
}
}
@ -122,7 +121,7 @@ impl SysrootUpgrader {
unsafe {
let mut value = Value::from_type(<GString as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"osname\0".as_ptr() as *const _, value.to_glib_none_mut().0);
value.get()
value.get().expect("Return Value for property `osname` getter")
}
}
@ -130,11 +129,11 @@ impl SysrootUpgrader {
unsafe {
let mut value = Value::from_type(<Sysroot as StaticType>::static_type());
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"sysroot\0".as_ptr() as *const _, value.to_glib_none_mut().0);
value.get()
value.get().expect("Return Value for property `sysroot` getter")
}
}
pub fn check_timestamps(repo: &Repo, from_rev: &str, to_rev: &str) -> Result<(), Error> {
pub fn check_timestamps(repo: &Repo, from_rev: &str, to_rev: &str) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let _ = ostree_sys::ostree_sysroot_upgrader_check_timestamps(repo.to_glib_none().0, from_rev.to_glib_none().0, to_rev.to_glib_none().0, &mut error);

View File

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ c0f523f)
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
Generated by gir (https://github.com/gtk-rs/gir @ d1e88f9)
from gir-files (https://github.com/gtk-rs/gir-files @ a25ce65+)

View File

@ -5,14 +5,14 @@ repository = "fkrull/ostree-rs"
pkg-config = "0.3.7"
[dependencies]
gio-sys = "0.9.0"
glib-sys = "0.9.0"
gobject-sys = "0.9.0"
gio-sys = "0.9.1"
glib-sys = "0.9.1"
gobject-sys = "0.9.1"
libc = "0.2"
[dev-dependencies]
shell-words = "0.1.0"
tempdir = "0.3"
tempfile = "3"
[features]
v2014_9 = []
@ -63,6 +63,5 @@ links = "ostree-1"
name = "ostree-sys"
repository = "https://gitlab.com/fkrull/ostree-rs"
version = "0.5.2"
["package.metadata.docs.rs"]
features = ["dox", "v2019_6"]
[package.metadata.docs.rs]
features = ["dox"]

View File

@ -1,2 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ c0f523f)
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
Generated by gir (https://github.com/gtk-rs/gir @ d1e88f9)
from gir-files (https://github.com/gtk-rs/gir-files @ a25ce65+)

View File

@ -4,13 +4,14 @@
extern crate ostree_sys;
extern crate shell_words;
extern crate tempdir;
extern crate tempfile;
use std::env;
use std::error::Error;
use std::path::Path;
use std::mem::{align_of, size_of};
use std::process::Command;
use std::str;
use tempfile::Builder;
use ostree_sys::*;
static PACKAGES: &[&str] = &["ostree-1"];
@ -21,7 +22,7 @@ struct Compiler {
}
impl Compiler {
pub fn new() -> Result<Compiler, Box<Error>> {
pub fn new() -> Result<Compiler, Box<dyn Error>> {
let mut args = get_var("CC", "cc")?;
args.push("-Wno-deprecated-declarations".to_owned());
// For %z support in printf when using MinGW.
@ -40,7 +41,7 @@ impl Compiler {
self.args.push(arg);
}
pub fn compile(&self, src: &Path, out: &Path) -> Result<(), Box<Error>> {
pub fn compile(&self, src: &Path, out: &Path) -> Result<(), Box<dyn Error>> {
let mut cmd = self.to_command();
cmd.arg(src);
cmd.arg("-o");
@ -60,7 +61,7 @@ impl Compiler {
}
}
fn get_var(name: &str, default: &str) -> Result<Vec<String>, Box<Error>> {
fn get_var(name: &str, default: &str) -> Result<Vec<String>, Box<dyn Error>> {
match env::var(name) {
Ok(value) => Ok(shell_words::split(&value)?),
Err(env::VarError::NotPresent) => Ok(shell_words::split(default)?),
@ -68,7 +69,7 @@ fn get_var(name: &str, default: &str) -> Result<Vec<String>, Box<Error>> {
}
}
fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<Error>> {
fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>> {
if packages.is_empty() {
return Ok(Vec::new());
}
@ -130,7 +131,7 @@ impl Results {
#[test]
fn cross_validate_constants_with_c() {
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
let tmpdir = Builder::new().prefix("abi").tempdir().expect("temporary directory");
let cc = Compiler::new().expect("configured compiler");
assert_eq!("1",
@ -163,7 +164,7 @@ fn cross_validate_constants_with_c() {
#[test]
fn cross_validate_layout_with_c() {
let tmpdir = tempdir::TempDir::new("abi").expect("temporary directory");
let tmpdir = Builder::new().prefix("abi").tempdir().expect("temporary directory");
let cc = Compiler::new().expect("configured compiler");
assert_eq!(Layout {size: 1, alignment: 1},
@ -194,7 +195,7 @@ fn cross_validate_layout_with_c() {
results.expect_total_success();
}
fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Error>> {
fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<dyn Error>> {
let exe = dir.join("layout");
let mut cc = cc.clone();
cc.define("ABI_TYPE_NAME", name);
@ -214,7 +215,7 @@ fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<Err
Ok(Layout {size, alignment})
}
fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<Error>> {
fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<dyn Error>> {
let exe = dir.join("constant");
let mut cc = cc.clone();
cc.define("ABI_CONSTANT_NAME", name);