diff --git a/rust-bindings/rust/conf/ostree.toml b/rust-bindings/rust/conf/ostree.toml index 3a2d3746..5185d435 100644 --- a/rust-bindings/rust/conf/ostree.toml +++ b/rust-bindings/rust/conf/ostree.toml @@ -54,16 +54,22 @@ generate = [ ] manual = [ + "Gio.AsyncReadyCallback", + "Gio.AsyncResult", "Gio.Cancellable", "Gio.File", "Gio.FileInfo", "Gio.FileQueryInfoFlags", "Gio.InputStream", + "Gio.VolumeMonitor", "GLib.Bytes", "GLib.Error", "GLib.KeyFile", + "GLib.MainContext", + "GLib.Quark", "GLib.String", "GLib.Variant", + "GLib.VariantType", "OSTree.RepoCheckoutAtOptions", "OSTree.RepoCheckoutFilter", diff --git a/rust-bindings/rust/src/auto/functions.rs b/rust-bindings/rust/src/auto/functions.rs index fe780ad6..c59f5ede 100644 --- a/rust-bindings/rust/src/auto/functions.rs +++ b/rust-bindings/rust/src/auto/functions.rs @@ -172,18 +172,22 @@ pub fn create_directory_metadata(dir_info: &gio::FileInfo, xattrs: Option<&glib: // unsafe { TODO: call ostree_sys:ostree_diff_print() } //} -//#[cfg(any(feature = "v2017_10", feature = "dox"))] -//pub fn gpg_error_quark() -> /*Ignored*/glib::Quark { -// unsafe { TODO: call ostree_sys:ostree_gpg_error_quark() } -//} +#[cfg(any(feature = "v2017_10", feature = "dox"))] +pub fn gpg_error_quark() -> glib::Quark { + unsafe { + from_glib(ostree_sys::ostree_gpg_error_quark()) + } +} //pub fn hash_object_name(a: /*Unimplemented*/Option) -> u32 { // unsafe { TODO: call ostree_sys:ostree_hash_object_name() } //} -//pub fn metadata_variant_type(objtype: ObjectType) -> /*Ignored*/Option { -// unsafe { TODO: call ostree_sys:ostree_metadata_variant_type() } -//} +pub fn metadata_variant_type(objtype: ObjectType) -> Option { + unsafe { + from_glib_none(ostree_sys::ostree_metadata_variant_type(objtype.to_glib())) + } +} pub fn object_from_string(str: &str) -> (GString, ObjectType) { unsafe { diff --git a/rust-bindings/rust/src/auto/mod.rs b/rust-bindings/rust/src/auto/mod.rs index dbcc6ef9..be200cec 100644 --- a/rust-bindings/rust/src/auto/mod.rs +++ b/rust-bindings/rust/src/auto/mod.rs @@ -30,11 +30,8 @@ mod repo_finder; pub use self::repo_finder::{RepoFinder, NONE_REPO_FINDER}; pub use self::repo_finder::RepoFinderExt; -#[cfg(any(feature = "v2018_6", feature = "dox"))] mod repo_finder_avahi; -#[cfg(any(feature = "v2018_6", feature = "dox"))] pub use self::repo_finder_avahi::{RepoFinderAvahi, RepoFinderAvahiClass, NONE_REPO_FINDER_AVAHI}; -#[cfg(any(feature = "v2018_6", feature = "dox"))] pub use self::repo_finder_avahi::RepoFinderAvahiExt; #[cfg(any(feature = "v2018_6", feature = "dox"))] @@ -42,8 +39,11 @@ mod repo_finder_config; #[cfg(any(feature = "v2018_6", feature = "dox"))] pub use self::repo_finder_config::{RepoFinderConfig, RepoFinderConfigClass, NONE_REPO_FINDER_CONFIG}; +#[cfg(any(feature = "v2018_6", feature = "dox"))] mod repo_finder_mount; +#[cfg(any(feature = "v2018_6", feature = "dox"))] pub use self::repo_finder_mount::{RepoFinderMount, RepoFinderMountClass, NONE_REPO_FINDER_MOUNT}; +#[cfg(any(feature = "v2018_6", feature = "dox"))] pub use self::repo_finder_mount::RepoFinderMountExt; #[cfg(any(feature = "v2018_6", feature = "dox"))] @@ -151,8 +151,8 @@ pub mod traits { pub use super::MutableTreeExt; pub use super::RepoFileExt; pub use super::RepoFinderExt; - #[cfg(any(feature = "v2018_6", feature = "dox"))] pub use super::RepoFinderAvahiExt; + #[cfg(any(feature = "v2018_6", feature = "dox"))] pub use super::RepoFinderMountExt; #[cfg(any(feature = "v2018_6", feature = "dox"))] pub use super::RepoFinderOverrideExt; diff --git a/rust-bindings/rust/src/auto/repo.rs b/rust-bindings/rust/src/auto/repo.rs index 7e942f8c..08bec4a0 100644 --- a/rust-bindings/rust/src/auto/repo.rs +++ b/rust-bindings/rust/src/auto/repo.rs @@ -19,6 +19,8 @@ use RepoCommitModifier; #[cfg(any(feature = "v2015_7", feature = "dox"))] use RepoCommitState; use RepoFile; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use RepoFinderResult; use RepoMode; use RepoPruneFlags; use RepoPullFlags; diff --git a/rust-bindings/rust/src/auto/repo_finder_avahi.rs b/rust-bindings/rust/src/auto/repo_finder_avahi.rs index 642f730f..0212423f 100644 --- a/rust-bindings/rust/src/auto/repo_finder_avahi.rs +++ b/rust-bindings/rust/src/auto/repo_finder_avahi.rs @@ -5,6 +5,7 @@ #[cfg(any(feature = "v2018_6", feature = "dox"))] use Error; use RepoFinder; +use glib; use glib::object::IsA; use glib::translate::*; use ostree_sys; @@ -21,9 +22,11 @@ glib_wrapper! { } impl RepoFinderAvahi { - //pub fn new(context: /*Ignored*/&glib::MainContext) -> RepoFinderAvahi { - // unsafe { TODO: call ostree_sys:ostree_repo_finder_avahi_new() } - //} + pub fn new(context: &glib::MainContext) -> RepoFinderAvahi { + unsafe { + from_glib_full(ostree_sys::ostree_repo_finder_avahi_new(context.to_glib_none().0)) + } + } } pub const NONE_REPO_FINDER_AVAHI: Option<&RepoFinderAvahi> = None; diff --git a/rust-bindings/rust/src/auto/repo_finder_mount.rs b/rust-bindings/rust/src/auto/repo_finder_mount.rs index f70fe638..39de766c 100644 --- a/rust-bindings/rust/src/auto/repo_finder_mount.rs +++ b/rust-bindings/rust/src/auto/repo_finder_mount.rs @@ -3,8 +3,16 @@ // DO NOT EDIT use RepoFinder; +#[cfg(any(feature = "v2018_6", feature = "dox"))] +use gio; +#[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; @@ -17,28 +25,30 @@ glib_wrapper! { } impl RepoFinderMount { - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //pub fn new(monitor: /*Ignored*/Option<&gio::VolumeMonitor>) -> RepoFinderMount { - // unsafe { TODO: call ostree_sys:ostree_repo_finder_mount_new() } - //} + #[cfg(any(feature = "v2018_6", feature = "dox"))] + pub fn new>(monitor: Option<&P>) -> RepoFinderMount { + unsafe { + from_glib_full(ostree_sys::ostree_repo_finder_mount_new(monitor.map(|p| p.as_ref()).to_glib_none().0)) + } + } } pub const NONE_REPO_FINDER_MOUNT: Option<&RepoFinderMount> = None; pub trait RepoFinderMountExt: 'static { - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //fn get_property_monitor(&self) -> /*Ignored*/Option; + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn get_property_monitor(&self) -> Option; } impl> RepoFinderMountExt for O { - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //fn get_property_monitor(&self) -> /*Ignored*/Option { - // unsafe { - // let mut value = Value::from_type(::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() - // } - //} + #[cfg(any(feature = "v2018_6", feature = "dox"))] + fn get_property_monitor(&self) -> Option { + unsafe { + let mut value = Value::from_type(::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() + } + } } impl fmt::Display for RepoFinderMount {