diff --git a/Cargo.toml b/Cargo.toml index dc87f9486a..cebf799aaa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,9 +36,9 @@ members = [".", "rust-bindings/sys"] [dependencies] base64 = "0.20.0" bitflags = "1.2.1" -ffi = { package = "ostree-sys", path = "rust-bindings/sys", version = "0.14.0" } -gio = "0.18" -glib = "0.18" +ffi = { package = "ostree-sys", path = "rust-bindings/sys", version = "0.15.0" } +gio = "0.19" +glib = "0.19" hex = "0.4.2" libc = "0.2" once_cell = "1.4.0" diff --git a/rust-bindings/Makefile b/rust-bindings/Makefile index 05bafde311..110ead2e71 100644 --- a/rust-bindings/Makefile +++ b/rust-bindings/Makefile @@ -1,5 +1,5 @@ -GIR_REPO := https://github.com/gtk-rs/gir.git -GIR_VERSION := 0eeebbdf9d4d5a0b0148c7fa055bf961e16e54a0 +d .GIR_REPO := https://github.com/gtk-rs/gir.git +GIR_VERSION := 0.19 OSTREE_REPO := ../ostree OSTREE_VERSION := patch-v2022.2 RUSTDOC_STRIPPER_VERSION := 0.1.17 @@ -11,7 +11,7 @@ all: gir # -- gir generation -- target/tools/bin/gir: - cargo install --root target/tools --git $(GIR_REPO) --rev $(GIR_VERSION) -- gir + cargo install --root target/tools --git $(GIR_REPO) --branch $(GIR_VERSION) -- gir gir: target/tools/bin/gir target/tools/bin/gir -c conf/ostree-sys.toml @@ -35,6 +35,7 @@ update-gir-files: \ remove-gir-files \ gir-files \ gir-files/GLib-2.0.gir \ + gir-files/GModule-2.0.gir \ gir-files/Gio-2.0.gir \ gir-files/GObject-2.0.gir \ gir-files/OSTree-1.0.gir @@ -46,7 +47,7 @@ gir-files: mkdir -p gir-files %.gir: - curl -o $@ -L https://github.com/gtk-rs/gir-files/raw/0.18/${@F} + curl -o $@ -L https://github.com/gtk-rs/gir-files/raw/0.19/${@F} gir-files/OSTree-1.0.gir: ln -sfr ../OSTree-1.0.gir $@ diff --git a/rust-bindings/src/auto/async_progress.rs b/rust-bindings/src/auto/async_progress.rs index 2706d5b4d8..090a9a40f0 100644 --- a/rust-bindings/src/auto/async_progress.rs +++ b/rust-bindings/src/auto/async_progress.rs @@ -2,13 +2,8 @@ // from gir-files // DO NOT EDIT -use glib::object::ObjectType as ObjectType_; -use glib::signal::connect_raw; -use glib::signal::SignalHandlerId; -use glib::translate::*; -use std::boxed::Box as Box_; -use std::fmt; -use std::mem::transmute; +use glib::{prelude::*,signal::{connect_raw, SignalHandlerId},translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "OstreeAsyncProgress")] @@ -32,8 +27,8 @@ impl AsyncProgress { // unsafe { TODO: call ffi:ostree_async_progress_new_and_connect() } //} - #[cfg(any(feature = "v2019_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_6")))] + #[cfg(feature = "v2019_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_6")))] #[doc(alias = "ostree_async_progress_copy_state")] pub fn copy_state(&self, dest: &AsyncProgress) { unsafe { @@ -48,15 +43,15 @@ impl AsyncProgress { } } - //#[cfg(any(feature = "v2017_6", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))] + //#[cfg(feature = "v2017_6")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))] //#[doc(alias = "ostree_async_progress_get")] //pub fn get(&self, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) { // unsafe { TODO: call ffi:ostree_async_progress_get() } //} - #[cfg(any(feature = "v2017_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))] + #[cfg(feature = "v2017_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))] #[doc(alias = "ostree_async_progress_get_status")] #[doc(alias = "get_status")] pub fn status(&self) -> Option { @@ -81,8 +76,8 @@ impl AsyncProgress { } } - #[cfg(any(feature = "v2017_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))] + #[cfg(feature = "v2017_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))] #[doc(alias = "ostree_async_progress_get_variant")] #[doc(alias = "get_variant")] pub fn variant(&self, key: &str) -> Option { @@ -91,15 +86,15 @@ impl AsyncProgress { } } - //#[cfg(any(feature = "v2017_6", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))] + //#[cfg(feature = "v2017_6")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))] //#[doc(alias = "ostree_async_progress_set")] //pub fn set(&self, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) { // unsafe { TODO: call ffi:ostree_async_progress_set() } //} - #[cfg(any(feature = "v2017_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))] + #[cfg(feature = "v2017_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))] #[doc(alias = "ostree_async_progress_set_status")] pub fn set_status(&self, status: Option<&str>) { unsafe { @@ -121,8 +116,8 @@ impl AsyncProgress { } } - #[cfg(any(feature = "v2017_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))] + #[cfg(feature = "v2017_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))] #[doc(alias = "ostree_async_progress_set_variant")] pub fn set_variant(&self, key: &str, value: &glib::Variant) { unsafe { @@ -139,7 +134,7 @@ impl AsyncProgress { unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"changed\0".as_ptr() as *const _, - Some(transmute::<_, unsafe extern "C" fn()>(changed_trampoline:: as *const ())), Box_::into_raw(f)) + Some(std::mem::transmute::<_, unsafe extern "C" fn()>(changed_trampoline:: as *const ())), Box_::into_raw(f)) } } } @@ -149,9 +144,3 @@ impl Default for AsyncProgress { Self::new() } } - -impl fmt::Display for AsyncProgress { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("AsyncProgress") - } -} diff --git a/rust-bindings/src/auto/bootconfig_parser.rs b/rust-bindings/src/auto/bootconfig_parser.rs index 0f59255fab..8924bc8537 100644 --- a/rust-bindings/src/auto/bootconfig_parser.rs +++ b/rust-bindings/src/auto/bootconfig_parser.rs @@ -2,10 +2,7 @@ // from gir-files // DO NOT EDIT -use glib::object::IsA; -use glib::translate::*; -use std::fmt; -use std::ptr; +use glib::{prelude::*,translate::*}; glib::wrapper! { #[doc(alias = "OstreeBootconfigParser")] @@ -39,8 +36,8 @@ impl BootconfigParser { } } - #[cfg(any(feature = "v2020_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] + #[cfg(feature = "v2020_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] #[doc(alias = "ostree_bootconfig_parser_get_overlay_initrds")] #[doc(alias = "get_overlay_initrds")] pub fn overlay_initrds(&self) -> Vec { @@ -52,9 +49,9 @@ impl BootconfigParser { #[doc(alias = "ostree_bootconfig_parser_parse")] pub fn parse(&self, path: &impl IsA, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -62,9 +59,9 @@ impl BootconfigParser { #[doc(alias = "ostree_bootconfig_parser_parse_at")] pub fn parse_at(&self, dfd: i32, path: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -76,8 +73,8 @@ impl BootconfigParser { } } - #[cfg(any(feature = "v2020_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] + #[cfg(feature = "v2020_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] #[doc(alias = "ostree_bootconfig_parser_set_overlay_initrds")] pub fn set_overlay_initrds(&self, initrds: &[&str]) { unsafe { @@ -88,9 +85,9 @@ impl BootconfigParser { #[doc(alias = "ostree_bootconfig_parser_write")] pub fn write(&self, output: &impl IsA, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -98,9 +95,9 @@ impl BootconfigParser { #[doc(alias = "ostree_bootconfig_parser_write_at")] pub fn write_at(&self, dfd: i32, path: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -111,9 +108,3 @@ impl Default for BootconfigParser { Self::new() } } - -impl fmt::Display for BootconfigParser { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("BootconfigParser") - } -} diff --git a/rust-bindings/src/auto/collection_ref.rs b/rust-bindings/src/auto/collection_ref.rs index cb3bf4093e..bfbfe21b57 100644 --- a/rust-bindings/src/auto/collection_ref.rs +++ b/rust-bindings/src/auto/collection_ref.rs @@ -2,8 +2,7 @@ // from gir-files // DO NOT EDIT -use glib::translate::*; -use std::hash; +use glib::{translate::*}; glib::wrapper! { #[derive(Debug, PartialOrd, Ord)] @@ -48,9 +47,9 @@ impl PartialEq for CollectionRef { impl Eq for CollectionRef {} -impl hash::Hash for CollectionRef { +impl std::hash::Hash for CollectionRef { #[inline] - fn hash(&self, state: &mut H) where H: hash::Hasher { - hash::Hash::hash(&self.hash(), state) + fn hash(&self, state: &mut H) where H: std::hash::Hasher { + std::hash::Hash::hash(&self.hash(), state) } } diff --git a/rust-bindings/src/auto/commit_sizes_entry.rs b/rust-bindings/src/auto/commit_sizes_entry.rs index c52ecc5c6e..2923a8c1f3 100644 --- a/rust-bindings/src/auto/commit_sizes_entry.rs +++ b/rust-bindings/src/auto/commit_sizes_entry.rs @@ -2,8 +2,8 @@ // from gir-files // DO NOT EDIT -use crate::ObjectType; -use glib::translate::*; +use crate::{ObjectType}; +use glib::{translate::*}; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] diff --git a/rust-bindings/src/auto/constants.rs b/rust-bindings/src/auto/constants.rs index 396d5c85a1..e34e2bfbdd 100644 --- a/rust-bindings/src/auto/constants.rs +++ b/rust-bindings/src/auto/constants.rs @@ -2,75 +2,75 @@ // from gir-files // DO NOT EDIT -use std::ffi::CStr; +use glib::{GStr}; #[doc(alias = "OSTREE_COMMIT_GVARIANT_STRING")] -pub static COMMIT_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_GVARIANT_STRING).to_str().unwrap()}); -#[cfg(any(feature = "v2020_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))] +pub static COMMIT_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_GVARIANT_STRING)}; +#[cfg(feature = "v2020_4")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))] #[doc(alias = "OSTREE_COMMIT_META_KEY_ARCHITECTURE")] -pub static COMMIT_META_KEY_ARCHITECTURE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_ARCHITECTURE).to_str().unwrap()}); -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] +pub static COMMIT_META_KEY_ARCHITECTURE: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_META_KEY_ARCHITECTURE)}; +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "OSTREE_COMMIT_META_KEY_COLLECTION_BINDING")] -pub static COMMIT_META_KEY_COLLECTION_BINDING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_COLLECTION_BINDING).to_str().unwrap()}); -#[cfg(any(feature = "v2017_7", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))] +pub static COMMIT_META_KEY_COLLECTION_BINDING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_META_KEY_COLLECTION_BINDING)}; +#[cfg(feature = "v2017_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))] #[doc(alias = "OSTREE_COMMIT_META_KEY_ENDOFLIFE")] -pub static COMMIT_META_KEY_ENDOFLIFE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_ENDOFLIFE).to_str().unwrap()}); -#[cfg(any(feature = "v2017_7", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))] +pub static COMMIT_META_KEY_ENDOFLIFE: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_META_KEY_ENDOFLIFE)}; +#[cfg(feature = "v2017_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))] #[doc(alias = "OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE")] -pub static COMMIT_META_KEY_ENDOFLIFE_REBASE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE).to_str().unwrap()}); -#[cfg(any(feature = "v2017_9", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_9")))] +pub static COMMIT_META_KEY_ENDOFLIFE_REBASE: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE)}; +#[cfg(feature = "v2017_9")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_9")))] #[doc(alias = "OSTREE_COMMIT_META_KEY_REF_BINDING")] -pub static COMMIT_META_KEY_REF_BINDING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_REF_BINDING).to_str().unwrap()}); -#[cfg(any(feature = "v2017_13", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))] +pub static COMMIT_META_KEY_REF_BINDING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_META_KEY_REF_BINDING)}; +#[cfg(feature = "v2017_13")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))] #[doc(alias = "OSTREE_COMMIT_META_KEY_SOURCE_TITLE")] -pub static COMMIT_META_KEY_SOURCE_TITLE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_SOURCE_TITLE).to_str().unwrap()}); -#[cfg(any(feature = "v2014_9", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2014_9")))] +pub static COMMIT_META_KEY_SOURCE_TITLE: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_META_KEY_SOURCE_TITLE)}; +#[cfg(feature = "v2014_9")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2014_9")))] #[doc(alias = "OSTREE_COMMIT_META_KEY_VERSION")] -pub static COMMIT_META_KEY_VERSION: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_VERSION).to_str().unwrap()}); +pub static COMMIT_META_KEY_VERSION: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_COMMIT_META_KEY_VERSION)}; #[doc(alias = "OSTREE_DIRMETA_GVARIANT_STRING")] -pub static DIRMETA_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_DIRMETA_GVARIANT_STRING).to_str().unwrap()}); +pub static DIRMETA_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_DIRMETA_GVARIANT_STRING)}; #[doc(alias = "OSTREE_FILEMETA_GVARIANT_STRING")] -pub static FILEMETA_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_FILEMETA_GVARIANT_STRING).to_str().unwrap()}); +pub static FILEMETA_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_FILEMETA_GVARIANT_STRING)}; #[doc(alias = "OSTREE_GPG_KEY_GVARIANT_STRING")] -pub static GPG_KEY_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_GPG_KEY_GVARIANT_STRING).to_str().unwrap()}); -#[cfg(any(feature = "v2021_1", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))] +pub static GPG_KEY_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_GPG_KEY_GVARIANT_STRING)}; +#[cfg(feature = "v2021_1")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))] #[doc(alias = "OSTREE_METADATA_KEY_BOOTABLE")] -pub static METADATA_KEY_BOOTABLE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_METADATA_KEY_BOOTABLE).to_str().unwrap()}); -#[cfg(any(feature = "v2021_1", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))] +pub static METADATA_KEY_BOOTABLE: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_METADATA_KEY_BOOTABLE)}; +#[cfg(feature = "v2021_1")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))] #[doc(alias = "OSTREE_METADATA_KEY_LINUX")] -pub static METADATA_KEY_LINUX: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_METADATA_KEY_LINUX).to_str().unwrap()}); -#[cfg(any(feature = "v2018_9", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_9")))] +pub static METADATA_KEY_LINUX: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_METADATA_KEY_LINUX)}; +#[cfg(feature = "v2018_9")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_9")))] #[doc(alias = "OSTREE_META_KEY_DEPLOY_COLLECTION_ID")] -pub static META_KEY_DEPLOY_COLLECTION_ID: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_META_KEY_DEPLOY_COLLECTION_ID).to_str().unwrap()}); -#[cfg(any(feature = "v2018_3", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))] +pub static META_KEY_DEPLOY_COLLECTION_ID: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_META_KEY_DEPLOY_COLLECTION_ID)}; +#[cfg(feature = "v2018_3")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))] #[doc(alias = "OSTREE_ORIGIN_TRANSIENT_GROUP")] -pub static ORIGIN_TRANSIENT_GROUP: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_ORIGIN_TRANSIENT_GROUP).to_str().unwrap()}); -#[cfg(any(feature = "v2022_2", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2022_2")))] +pub static ORIGIN_TRANSIENT_GROUP: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_ORIGIN_TRANSIENT_GROUP)}; +#[cfg(feature = "v2022_2")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2022_2")))] #[doc(alias = "OSTREE_PATH_BOOTED")] -pub static PATH_BOOTED: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_PATH_BOOTED).to_str().unwrap()}); -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] +pub static PATH_BOOTED: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_PATH_BOOTED)}; +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "OSTREE_REPO_METADATA_REF")] -pub static REPO_METADATA_REF: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_REPO_METADATA_REF).to_str().unwrap()}); -#[cfg(any(feature = "v2020_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))] +pub static REPO_METADATA_REF: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_REPO_METADATA_REF)}; +#[cfg(feature = "v2020_4")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))] #[doc(alias = "OSTREE_SIGN_NAME_ED25519")] -pub static SIGN_NAME_ED25519: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_SIGN_NAME_ED25519).to_str().unwrap()}); +pub static SIGN_NAME_ED25519: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_SIGN_NAME_ED25519)}; #[doc(alias = "OSTREE_SUMMARY_GVARIANT_STRING")] -pub static SUMMARY_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_SUMMARY_GVARIANT_STRING).to_str().unwrap()}); +pub static SUMMARY_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_SUMMARY_GVARIANT_STRING)}; #[doc(alias = "OSTREE_SUMMARY_SIG_GVARIANT_STRING")] -pub static SUMMARY_SIG_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_SUMMARY_SIG_GVARIANT_STRING).to_str().unwrap()}); +pub static SUMMARY_SIG_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_SUMMARY_SIG_GVARIANT_STRING)}; #[doc(alias = "OSTREE_TREE_GVARIANT_STRING")] -pub static TREE_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_TREE_GVARIANT_STRING).to_str().unwrap()}); +pub static TREE_GVARIANT_STRING: &GStr = unsafe{GStr::from_utf8_with_nul_unchecked(ffi::OSTREE_TREE_GVARIANT_STRING)}; diff --git a/rust-bindings/src/auto/content_writer.rs b/rust-bindings/src/auto/content_writer.rs index 4151b28eda..28b7514372 100644 --- a/rust-bindings/src/auto/content_writer.rs +++ b/rust-bindings/src/auto/content_writer.rs @@ -2,10 +2,7 @@ // from gir-files // DO NOT EDIT -use glib::object::IsA; -use glib::translate::*; -use std::fmt; -use std::ptr; +use glib::{prelude::*,translate::*}; glib::wrapper! { #[doc(alias = "OstreeContentWriter")] @@ -20,15 +17,9 @@ impl ContentWriter { #[doc(alias = "ostree_content_writer_finish")] pub fn finish(&self, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_content_writer_finish(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } } - -impl fmt::Display for ContentWriter { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("ContentWriter") - } -} diff --git a/rust-bindings/src/auto/deployment.rs b/rust-bindings/src/auto/deployment.rs index a8dde0e590..3bb9ed8bfd 100644 --- a/rust-bindings/src/auto/deployment.rs +++ b/rust-bindings/src/auto/deployment.rs @@ -2,12 +2,11 @@ // from gir-files // DO NOT EDIT -use crate::BootconfigParser; -#[cfg(any(feature = "v2016_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] -use crate::DeploymentUnlockedState; -use glib::translate::*; -use std::fmt; +use crate::{BootconfigParser}; +#[cfg(feature = "v2016_4")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] +use crate::{DeploymentUnlockedState}; +use glib::{translate::*}; glib::wrapper! { #[doc(alias = "OstreeDeployment")] @@ -113,8 +112,8 @@ impl Deployment { } } - #[cfg(any(feature = "v2016_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] + #[cfg(feature = "v2016_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] #[doc(alias = "ostree_deployment_get_unlocked")] #[doc(alias = "get_unlocked")] pub fn unlocked(&self) -> DeploymentUnlockedState { @@ -130,8 +129,8 @@ impl Deployment { } } - #[cfg(any(feature = "v2023_8", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2023_8")))] + #[cfg(feature = "v2023_8")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2023_8")))] #[doc(alias = "ostree_deployment_is_finalization_locked")] pub fn is_finalization_locked(&self) -> bool { unsafe { @@ -139,8 +138,8 @@ impl Deployment { } } - #[cfg(any(feature = "v2018_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))] + #[cfg(feature = "v2018_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))] #[doc(alias = "ostree_deployment_is_pinned")] pub fn is_pinned(&self) -> bool { unsafe { @@ -148,8 +147,8 @@ impl Deployment { } } - #[cfg(any(feature = "v2018_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))] + #[cfg(feature = "v2018_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))] #[doc(alias = "ostree_deployment_is_staged")] pub fn is_staged(&self) -> bool { unsafe { @@ -185,8 +184,8 @@ impl Deployment { } } - #[cfg(any(feature = "v2018_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))] + #[cfg(feature = "v2018_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))] #[doc(alias = "ostree_deployment_origin_remove_transient_state")] pub fn origin_remove_transient_state(origin: &glib::KeyFile) { unsafe { @@ -194,8 +193,8 @@ impl Deployment { } } - #[cfg(any(feature = "v2016_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] + #[cfg(feature = "v2016_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] #[doc(alias = "ostree_deployment_unlocked_state_to_string")] pub fn unlocked_state_to_string(state: DeploymentUnlockedState) -> glib::GString { unsafe { @@ -203,9 +202,3 @@ impl Deployment { } } } - -impl fmt::Display for Deployment { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("Deployment") - } -} diff --git a/rust-bindings/src/auto/enums.rs b/rust-bindings/src/auto/enums.rs index 2eecdb9752..d411b4a986 100644 --- a/rust-bindings/src/auto/enums.rs +++ b/rust-bindings/src/auto/enums.rs @@ -2,8 +2,7 @@ // from gir-files // DO NOT EDIT -use glib::translate::*; -use std::fmt; +use glib::{translate::*}; #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] @@ -22,44 +21,35 @@ pub enum DeploymentUnlockedState { __Unknown(i32), } -impl fmt::Display for DeploymentUnlockedState { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "DeploymentUnlockedState::{}", match *self { - Self::None => "None", - Self::Development => "Development", - Self::Hotfix => "Hotfix", - Self::Transient => "Transient", - _ => "Unknown", - }) - } -} - #[doc(hidden)] impl IntoGlib for DeploymentUnlockedState { type GlibType = ffi::OstreeDeploymentUnlockedState; - fn into_glib(self) -> ffi::OstreeDeploymentUnlockedState { - match self { + #[inline] +fn into_glib(self) -> ffi::OstreeDeploymentUnlockedState { +match self { Self::None => ffi::OSTREE_DEPLOYMENT_UNLOCKED_NONE, Self::Development => ffi::OSTREE_DEPLOYMENT_UNLOCKED_DEVELOPMENT, Self::Hotfix => ffi::OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX, Self::Transient => ffi::OSTREE_DEPLOYMENT_UNLOCKED_TRANSIENT, Self::__Unknown(value) => value, } - } +} } #[doc(hidden)] impl FromGlib for DeploymentUnlockedState { - unsafe fn from_glib(value: ffi::OstreeDeploymentUnlockedState) -> Self { - match value { + #[inline] +unsafe fn from_glib(value: ffi::OstreeDeploymentUnlockedState) -> Self { + +match value { ffi::OSTREE_DEPLOYMENT_UNLOCKED_NONE => Self::None, ffi::OSTREE_DEPLOYMENT_UNLOCKED_DEVELOPMENT => Self::Development, ffi::OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX => Self::Hotfix, ffi::OSTREE_DEPLOYMENT_UNLOCKED_TRANSIENT => Self::Transient, value => Self::__Unknown(value), } - } +} } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] @@ -101,35 +91,12 @@ pub enum GpgSignatureAttr { __Unknown(i32), } -impl fmt::Display for GpgSignatureAttr { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "GpgSignatureAttr::{}", match *self { - Self::Valid => "Valid", - Self::SigExpired => "SigExpired", - Self::KeyExpired => "KeyExpired", - Self::KeyRevoked => "KeyRevoked", - Self::KeyMissing => "KeyMissing", - Self::Fingerprint => "Fingerprint", - Self::Timestamp => "Timestamp", - Self::ExpTimestamp => "ExpTimestamp", - Self::PubkeyAlgoName => "PubkeyAlgoName", - Self::HashAlgoName => "HashAlgoName", - Self::UserName => "UserName", - Self::UserEmail => "UserEmail", - Self::FingerprintPrimary => "FingerprintPrimary", - Self::KeyExpTimestamp => "KeyExpTimestamp", - Self::KeyExpTimestampPrimary => "KeyExpTimestampPrimary", - _ => "Unknown", - }) - } -} - #[doc(hidden)] impl IntoGlib for GpgSignatureAttr { type GlibType = ffi::OstreeGpgSignatureAttr; fn into_glib(self) -> ffi::OstreeGpgSignatureAttr { - match self { +match self { Self::Valid => ffi::OSTREE_GPG_SIGNATURE_ATTR_VALID, Self::SigExpired => ffi::OSTREE_GPG_SIGNATURE_ATTR_SIG_EXPIRED, Self::KeyExpired => ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXPIRED, @@ -147,13 +114,14 @@ impl IntoGlib for GpgSignatureAttr { Self::KeyExpTimestampPrimary => ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP_PRIMARY, Self::__Unknown(value) => value, } - } +} } #[doc(hidden)] impl FromGlib for GpgSignatureAttr { unsafe fn from_glib(value: ffi::OstreeGpgSignatureAttr) -> Self { - match value { + +match value { ffi::OSTREE_GPG_SIGNATURE_ATTR_VALID => Self::Valid, ffi::OSTREE_GPG_SIGNATURE_ATTR_SIG_EXPIRED => Self::SigExpired, ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXPIRED => Self::KeyExpired, @@ -171,7 +139,7 @@ impl FromGlib for GpgSignatureAttr { ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP_PRIMARY => Self::KeyExpTimestampPrimary, value => Self::__Unknown(value), } - } +} } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] @@ -201,29 +169,13 @@ pub enum ObjectType { __Unknown(i32), } -impl fmt::Display for ObjectType { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "ObjectType::{}", match *self { - Self::File => "File", - Self::DirTree => "DirTree", - Self::DirMeta => "DirMeta", - Self::Commit => "Commit", - Self::TombstoneCommit => "TombstoneCommit", - Self::CommitMeta => "CommitMeta", - Self::PayloadLink => "PayloadLink", - Self::FileXattrs => "FileXattrs", - Self::FileXattrsLink => "FileXattrsLink", - _ => "Unknown", - }) - } -} - #[doc(hidden)] impl IntoGlib for ObjectType { type GlibType = ffi::OstreeObjectType; - fn into_glib(self) -> ffi::OstreeObjectType { - match self { + #[inline] +fn into_glib(self) -> ffi::OstreeObjectType { +match self { Self::File => ffi::OSTREE_OBJECT_TYPE_FILE, Self::DirTree => ffi::OSTREE_OBJECT_TYPE_DIR_TREE, Self::DirMeta => ffi::OSTREE_OBJECT_TYPE_DIR_META, @@ -235,13 +187,15 @@ impl IntoGlib for ObjectType { Self::FileXattrsLink => ffi::OSTREE_OBJECT_TYPE_FILE_XATTRS_LINK, Self::__Unknown(value) => value, } - } +} } #[doc(hidden)] impl FromGlib for ObjectType { - unsafe fn from_glib(value: ffi::OstreeObjectType) -> Self { - match value { + #[inline] +unsafe fn from_glib(value: ffi::OstreeObjectType) -> Self { + +match value { ffi::OSTREE_OBJECT_TYPE_FILE => Self::File, ffi::OSTREE_OBJECT_TYPE_DIR_TREE => Self::DirTree, ffi::OSTREE_OBJECT_TYPE_DIR_META => Self::DirMeta, @@ -253,11 +207,11 @@ impl FromGlib for ObjectType { ffi::OSTREE_OBJECT_TYPE_FILE_XATTRS_LINK => Self::FileXattrsLink, value => Self::__Unknown(value), } - } +} } -#[cfg(any(feature = "v2018_2", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))] +#[cfg(feature = "v2018_2")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_2")))] #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] #[derive(Clone, Copy)] #[non_exhaustive] @@ -271,44 +225,35 @@ pub enum RepoCheckoutFilterResult { __Unknown(i32), } -#[cfg(any(feature = "v2018_2", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))] -impl fmt::Display for RepoCheckoutFilterResult { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "RepoCheckoutFilterResult::{}", match *self { - Self::Allow => "Allow", - Self::Skip => "Skip", - _ => "Unknown", - }) - } -} - -#[cfg(any(feature = "v2018_2", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))] +#[cfg(feature = "v2018_2")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_2")))] #[doc(hidden)] impl IntoGlib for RepoCheckoutFilterResult { type GlibType = ffi::OstreeRepoCheckoutFilterResult; - fn into_glib(self) -> ffi::OstreeRepoCheckoutFilterResult { - match self { + #[inline] +fn into_glib(self) -> ffi::OstreeRepoCheckoutFilterResult { +match self { Self::Allow => ffi::OSTREE_REPO_CHECKOUT_FILTER_ALLOW, Self::Skip => ffi::OSTREE_REPO_CHECKOUT_FILTER_SKIP, Self::__Unknown(value) => value, } - } +} } -#[cfg(any(feature = "v2018_2", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))] +#[cfg(feature = "v2018_2")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_2")))] #[doc(hidden)] impl FromGlib for RepoCheckoutFilterResult { - unsafe fn from_glib(value: ffi::OstreeRepoCheckoutFilterResult) -> Self { - match value { + #[inline] +unsafe fn from_glib(value: ffi::OstreeRepoCheckoutFilterResult) -> Self { + +match value { ffi::OSTREE_REPO_CHECKOUT_FILTER_ALLOW => Self::Allow, ffi::OSTREE_REPO_CHECKOUT_FILTER_SKIP => Self::Skip, value => Self::__Unknown(value), } - } +} } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] @@ -324,38 +269,31 @@ pub enum RepoCheckoutMode { __Unknown(i32), } -impl fmt::Display for RepoCheckoutMode { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "RepoCheckoutMode::{}", match *self { - Self::None => "None", - Self::User => "User", - _ => "Unknown", - }) - } -} - #[doc(hidden)] impl IntoGlib for RepoCheckoutMode { type GlibType = ffi::OstreeRepoCheckoutMode; - fn into_glib(self) -> ffi::OstreeRepoCheckoutMode { - match self { + #[inline] +fn into_glib(self) -> ffi::OstreeRepoCheckoutMode { +match self { Self::None => ffi::OSTREE_REPO_CHECKOUT_MODE_NONE, Self::User => ffi::OSTREE_REPO_CHECKOUT_MODE_USER, Self::__Unknown(value) => value, } - } +} } #[doc(hidden)] impl FromGlib for RepoCheckoutMode { - unsafe fn from_glib(value: ffi::OstreeRepoCheckoutMode) -> Self { - match value { + #[inline] +unsafe fn from_glib(value: ffi::OstreeRepoCheckoutMode) -> Self { + +match value { ffi::OSTREE_REPO_CHECKOUT_MODE_NONE => Self::None, ffi::OSTREE_REPO_CHECKOUT_MODE_USER => Self::User, value => Self::__Unknown(value), } - } +} } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] @@ -375,44 +313,35 @@ pub enum RepoCheckoutOverwriteMode { __Unknown(i32), } -impl fmt::Display for RepoCheckoutOverwriteMode { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "RepoCheckoutOverwriteMode::{}", match *self { - Self::None => "None", - Self::UnionFiles => "UnionFiles", - Self::AddFiles => "AddFiles", - Self::UnionIdentical => "UnionIdentical", - _ => "Unknown", - }) - } -} - #[doc(hidden)] impl IntoGlib for RepoCheckoutOverwriteMode { type GlibType = ffi::OstreeRepoCheckoutOverwriteMode; - fn into_glib(self) -> ffi::OstreeRepoCheckoutOverwriteMode { - match self { + #[inline] +fn into_glib(self) -> ffi::OstreeRepoCheckoutOverwriteMode { +match self { Self::None => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_NONE, Self::UnionFiles => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES, Self::AddFiles => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES, Self::UnionIdentical => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL, Self::__Unknown(value) => value, } - } +} } #[doc(hidden)] impl FromGlib for RepoCheckoutOverwriteMode { - unsafe fn from_glib(value: ffi::OstreeRepoCheckoutOverwriteMode) -> Self { - match value { + #[inline] +unsafe fn from_glib(value: ffi::OstreeRepoCheckoutOverwriteMode) -> Self { + +match value { ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_NONE => Self::None, ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES => Self::UnionFiles, ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES => Self::AddFiles, ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL => Self::UnionIdentical, value => Self::__Unknown(value), } - } +} } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] @@ -428,38 +357,31 @@ pub enum RepoCommitFilterResult { __Unknown(i32), } -impl fmt::Display for RepoCommitFilterResult { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "RepoCommitFilterResult::{}", match *self { - Self::Allow => "Allow", - Self::Skip => "Skip", - _ => "Unknown", - }) - } -} - #[doc(hidden)] impl IntoGlib for RepoCommitFilterResult { type GlibType = ffi::OstreeRepoCommitFilterResult; - fn into_glib(self) -> ffi::OstreeRepoCommitFilterResult { - match self { + #[inline] +fn into_glib(self) -> ffi::OstreeRepoCommitFilterResult { +match self { Self::Allow => ffi::OSTREE_REPO_COMMIT_FILTER_ALLOW, Self::Skip => ffi::OSTREE_REPO_COMMIT_FILTER_SKIP, Self::__Unknown(value) => value, } - } +} } #[doc(hidden)] impl FromGlib for RepoCommitFilterResult { - unsafe fn from_glib(value: ffi::OstreeRepoCommitFilterResult) -> Self { - match value { + #[inline] +unsafe fn from_glib(value: ffi::OstreeRepoCommitFilterResult) -> Self { + +match value { ffi::OSTREE_REPO_COMMIT_FILTER_ALLOW => Self::Allow, ffi::OSTREE_REPO_COMMIT_FILTER_SKIP => Self::Skip, value => Self::__Unknown(value), } - } +} } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] @@ -479,44 +401,35 @@ pub enum RepoCommitIterResult { __Unknown(i32), } -impl fmt::Display for RepoCommitIterResult { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "RepoCommitIterResult::{}", match *self { - Self::Error => "Error", - Self::End => "End", - Self::File => "File", - Self::Dir => "Dir", - _ => "Unknown", - }) - } -} - #[doc(hidden)] impl IntoGlib for RepoCommitIterResult { type GlibType = ffi::OstreeRepoCommitIterResult; - fn into_glib(self) -> ffi::OstreeRepoCommitIterResult { - match self { + #[inline] +fn into_glib(self) -> ffi::OstreeRepoCommitIterResult { +match self { Self::Error => ffi::OSTREE_REPO_COMMIT_ITER_RESULT_ERROR, Self::End => ffi::OSTREE_REPO_COMMIT_ITER_RESULT_END, Self::File => ffi::OSTREE_REPO_COMMIT_ITER_RESULT_FILE, Self::Dir => ffi::OSTREE_REPO_COMMIT_ITER_RESULT_DIR, Self::__Unknown(value) => value, } - } +} } #[doc(hidden)] impl FromGlib for RepoCommitIterResult { - unsafe fn from_glib(value: ffi::OstreeRepoCommitIterResult) -> Self { - match value { + #[inline] +unsafe fn from_glib(value: ffi::OstreeRepoCommitIterResult) -> Self { + +match value { ffi::OSTREE_REPO_COMMIT_ITER_RESULT_ERROR => Self::Error, ffi::OSTREE_REPO_COMMIT_ITER_RESULT_END => Self::End, ffi::OSTREE_REPO_COMMIT_ITER_RESULT_FILE => Self::File, ffi::OSTREE_REPO_COMMIT_ITER_RESULT_DIR => Self::Dir, value => Self::__Unknown(value), } - } +} } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] @@ -538,25 +451,13 @@ pub enum RepoMode { __Unknown(i32), } -impl fmt::Display for RepoMode { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "RepoMode::{}", match *self { - Self::Bare => "Bare", - Self::Archive => "Archive", - Self::BareUser => "BareUser", - Self::BareUserOnly => "BareUserOnly", - Self::BareSplitXattrs => "BareSplitXattrs", - _ => "Unknown", - }) - } -} - #[doc(hidden)] impl IntoGlib for RepoMode { type GlibType = ffi::OstreeRepoMode; - fn into_glib(self) -> ffi::OstreeRepoMode { - match self { + #[inline] +fn into_glib(self) -> ffi::OstreeRepoMode { +match self { Self::Bare => ffi::OSTREE_REPO_MODE_BARE, Self::Archive => ffi::OSTREE_REPO_MODE_ARCHIVE, Self::BareUser => ffi::OSTREE_REPO_MODE_BARE_USER, @@ -564,13 +465,15 @@ impl IntoGlib for RepoMode { Self::BareSplitXattrs => ffi::OSTREE_REPO_MODE_BARE_SPLIT_XATTRS, Self::__Unknown(value) => value, } - } +} } #[doc(hidden)] impl FromGlib for RepoMode { - unsafe fn from_glib(value: ffi::OstreeRepoMode) -> Self { - match value { + #[inline] +unsafe fn from_glib(value: ffi::OstreeRepoMode) -> Self { + +match value { ffi::OSTREE_REPO_MODE_BARE => Self::Bare, ffi::OSTREE_REPO_MODE_ARCHIVE => Self::Archive, ffi::OSTREE_REPO_MODE_BARE_USER => Self::BareUser, @@ -578,7 +481,7 @@ impl FromGlib for RepoMode { ffi::OSTREE_REPO_MODE_BARE_SPLIT_XATTRS => Self::BareSplitXattrs, value => Self::__Unknown(value), } - } +} } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] @@ -600,25 +503,13 @@ pub enum RepoRemoteChange { __Unknown(i32), } -impl fmt::Display for RepoRemoteChange { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "RepoRemoteChange::{}", match *self { - Self::Add => "Add", - Self::AddIfNotExists => "AddIfNotExists", - Self::Delete => "Delete", - Self::DeleteIfExists => "DeleteIfExists", - Self::Replace => "Replace", - _ => "Unknown", - }) - } -} - #[doc(hidden)] impl IntoGlib for RepoRemoteChange { type GlibType = ffi::OstreeRepoRemoteChange; - fn into_glib(self) -> ffi::OstreeRepoRemoteChange { - match self { + #[inline] +fn into_glib(self) -> ffi::OstreeRepoRemoteChange { +match self { Self::Add => ffi::OSTREE_REPO_REMOTE_CHANGE_ADD, Self::AddIfNotExists => ffi::OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS, Self::Delete => ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE, @@ -626,13 +517,15 @@ impl IntoGlib for RepoRemoteChange { Self::Replace => ffi::OSTREE_REPO_REMOTE_CHANGE_REPLACE, Self::__Unknown(value) => value, } - } +} } #[doc(hidden)] impl FromGlib for RepoRemoteChange { - unsafe fn from_glib(value: ffi::OstreeRepoRemoteChange) -> Self { - match value { + #[inline] +unsafe fn from_glib(value: ffi::OstreeRepoRemoteChange) -> Self { + +match value { ffi::OSTREE_REPO_REMOTE_CHANGE_ADD => Self::Add, ffi::OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS => Self::AddIfNotExists, ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE => Self::Delete, @@ -640,7 +533,7 @@ impl FromGlib for RepoRemoteChange { ffi::OSTREE_REPO_REMOTE_CHANGE_REPLACE => Self::Replace, value => Self::__Unknown(value), } - } +} } #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] @@ -656,37 +549,30 @@ pub enum StaticDeltaGenerateOpt { __Unknown(i32), } -impl fmt::Display for StaticDeltaGenerateOpt { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "StaticDeltaGenerateOpt::{}", match *self { - Self::Lowlatency => "Lowlatency", - Self::Major => "Major", - _ => "Unknown", - }) - } -} - #[doc(hidden)] impl IntoGlib for StaticDeltaGenerateOpt { type GlibType = ffi::OstreeStaticDeltaGenerateOpt; - fn into_glib(self) -> ffi::OstreeStaticDeltaGenerateOpt { - match self { + #[inline] +fn into_glib(self) -> ffi::OstreeStaticDeltaGenerateOpt { +match self { Self::Lowlatency => ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY, Self::Major => ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR, Self::__Unknown(value) => value, } - } +} } #[doc(hidden)] impl FromGlib for StaticDeltaGenerateOpt { - unsafe fn from_glib(value: ffi::OstreeStaticDeltaGenerateOpt) -> Self { - match value { + #[inline] +unsafe fn from_glib(value: ffi::OstreeStaticDeltaGenerateOpt) -> Self { + +match value { ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY => Self::Lowlatency, ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR => Self::Major, value => Self::__Unknown(value), } - } +} } diff --git a/rust-bindings/src/auto/flags.rs b/rust-bindings/src/auto/flags.rs index 4cd95727b3..531a00ed46 100644 --- a/rust-bindings/src/auto/flags.rs +++ b/rust-bindings/src/auto/flags.rs @@ -2,17 +2,12 @@ // from gir-files // DO NOT EDIT -use bitflags::bitflags; -use glib::translate::*; -use glib::value::FromValue; -use glib::value::ToValue; -use glib::StaticType; -use glib::Type; -use std::fmt; - -#[cfg(any(feature = "v2017_13", feature = "dox"))] +use glib::{bitflags::bitflags,prelude::*,translate::*}; + +#[cfg(feature = "v2017_13")] bitflags! { - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))] + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeChecksumFlags")] pub struct ChecksumFlags: u32 { #[doc(alias = "OSTREE_CHECKSUM_FLAGS_NONE")] @@ -24,35 +19,30 @@ bitflags! { } } -#[cfg(any(feature = "v2017_13", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))] -impl fmt::Display for ChecksumFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - -#[cfg(any(feature = "v2017_13", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))] +#[cfg(feature = "v2017_13")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))] #[doc(hidden)] impl IntoGlib for ChecksumFlags { type GlibType = ffi::OstreeChecksumFlags; + #[inline] fn into_glib(self) -> ffi::OstreeChecksumFlags { self.bits() } } -#[cfg(any(feature = "v2017_13", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))] +#[cfg(feature = "v2017_13")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))] #[doc(hidden)] impl FromGlib for ChecksumFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeChecksumFlags) -> Self { Self::from_bits_truncate(value) } } bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeDiffFlags")] pub struct DiffFlags: u32 { #[doc(alias = "OSTREE_DIFF_FLAGS_NONE")] @@ -62,16 +52,11 @@ bitflags! { } } -impl fmt::Display for DiffFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - #[doc(hidden)] impl IntoGlib for DiffFlags { type GlibType = ffi::OstreeDiffFlags; + #[inline] fn into_glib(self) -> ffi::OstreeDiffFlags { self.bits() } @@ -79,12 +64,14 @@ impl IntoGlib for DiffFlags { #[doc(hidden)] impl FromGlib for DiffFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeDiffFlags) -> Self { Self::from_bits_truncate(value) } } bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeGpgSignatureFormatFlags")] pub struct GpgSignatureFormatFlags: u32 { #[doc(alias = "OSTREE_GPG_SIGNATURE_FORMAT_DEFAULT")] @@ -92,16 +79,11 @@ bitflags! { } } -impl fmt::Display for GpgSignatureFormatFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - #[doc(hidden)] impl IntoGlib for GpgSignatureFormatFlags { type GlibType = ffi::OstreeGpgSignatureFormatFlags; + #[inline] fn into_glib(self) -> ffi::OstreeGpgSignatureFormatFlags { self.bits() } @@ -109,12 +91,14 @@ impl IntoGlib for GpgSignatureFormatFlags { #[doc(hidden)] impl FromGlib for GpgSignatureFormatFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeGpgSignatureFormatFlags) -> Self { Self::from_bits_truncate(value) } } bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeRepoCommitModifierFlags")] pub struct RepoCommitModifierFlags: u32 { #[doc(alias = "OSTREE_REPO_COMMIT_MODIFIER_FLAGS_NONE")] @@ -136,16 +120,11 @@ bitflags! { } } -impl fmt::Display for RepoCommitModifierFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - #[doc(hidden)] impl IntoGlib for RepoCommitModifierFlags { type GlibType = ffi::OstreeRepoCommitModifierFlags; + #[inline] fn into_glib(self) -> ffi::OstreeRepoCommitModifierFlags { self.bits() } @@ -153,14 +132,16 @@ impl IntoGlib for RepoCommitModifierFlags { #[doc(hidden)] impl FromGlib for RepoCommitModifierFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeRepoCommitModifierFlags) -> Self { Self::from_bits_truncate(value) } } -#[cfg(any(feature = "v2015_7", feature = "dox"))] +#[cfg(feature = "v2015_7")] bitflags! { - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))] + #[cfg_attr(docsrs, doc(cfg(feature = "v2015_7")))] + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeRepoCommitState")] pub struct RepoCommitState: u32 { #[doc(alias = "OSTREE_REPO_COMMIT_STATE_NORMAL")] @@ -172,35 +153,30 @@ bitflags! { } } -#[cfg(any(feature = "v2015_7", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))] -impl fmt::Display for RepoCommitState { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - -#[cfg(any(feature = "v2015_7", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))] +#[cfg(feature = "v2015_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2015_7")))] #[doc(hidden)] impl IntoGlib for RepoCommitState { type GlibType = ffi::OstreeRepoCommitState; + #[inline] fn into_glib(self) -> ffi::OstreeRepoCommitState { self.bits() } } -#[cfg(any(feature = "v2015_7", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))] +#[cfg(feature = "v2015_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2015_7")))] #[doc(hidden)] impl FromGlib for RepoCommitState { + #[inline] unsafe fn from_glib(value: ffi::OstreeRepoCommitState) -> Self { Self::from_bits_truncate(value) } } bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeRepoCommitTraverseFlags")] pub struct RepoCommitTraverseFlags: u32 { #[doc(alias = "OSTREE_REPO_COMMIT_TRAVERSE_FLAG_NONE")] @@ -210,16 +186,11 @@ bitflags! { } } -impl fmt::Display for RepoCommitTraverseFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - #[doc(hidden)] impl IntoGlib for RepoCommitTraverseFlags { type GlibType = ffi::OstreeRepoCommitTraverseFlags; + #[inline] fn into_glib(self) -> ffi::OstreeRepoCommitTraverseFlags { self.bits() } @@ -227,12 +198,14 @@ impl IntoGlib for RepoCommitTraverseFlags { #[doc(hidden)] impl FromGlib for RepoCommitTraverseFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeRepoCommitTraverseFlags) -> Self { Self::from_bits_truncate(value) } } bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeRepoListObjectsFlags")] pub struct RepoListObjectsFlags: u32 { #[doc(alias = "OSTREE_REPO_LIST_OBJECTS_LOOSE")] @@ -246,16 +219,11 @@ bitflags! { } } -impl fmt::Display for RepoListObjectsFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - #[doc(hidden)] impl IntoGlib for RepoListObjectsFlags { type GlibType = ffi::OstreeRepoListObjectsFlags; + #[inline] fn into_glib(self) -> ffi::OstreeRepoListObjectsFlags { self.bits() } @@ -263,12 +231,14 @@ impl IntoGlib for RepoListObjectsFlags { #[doc(hidden)] impl FromGlib for RepoListObjectsFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeRepoListObjectsFlags) -> Self { Self::from_bits_truncate(value) } } bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeRepoListRefsExtFlags")] pub struct RepoListRefsExtFlags: u32 { #[doc(alias = "OSTREE_REPO_LIST_REFS_EXT_NONE")] @@ -282,16 +252,11 @@ bitflags! { } } -impl fmt::Display for RepoListRefsExtFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - #[doc(hidden)] impl IntoGlib for RepoListRefsExtFlags { type GlibType = ffi::OstreeRepoListRefsExtFlags; + #[inline] fn into_glib(self) -> ffi::OstreeRepoListRefsExtFlags { self.bits() } @@ -299,12 +264,14 @@ impl IntoGlib for RepoListRefsExtFlags { #[doc(hidden)] impl FromGlib for RepoListRefsExtFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeRepoListRefsExtFlags) -> Self { Self::from_bits_truncate(value) } } bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeRepoPruneFlags")] pub struct RepoPruneFlags: u32 { #[doc(alias = "OSTREE_REPO_PRUNE_FLAGS_NONE")] @@ -318,16 +285,11 @@ bitflags! { } } -impl fmt::Display for RepoPruneFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - #[doc(hidden)] impl IntoGlib for RepoPruneFlags { type GlibType = ffi::OstreeRepoPruneFlags; + #[inline] fn into_glib(self) -> ffi::OstreeRepoPruneFlags { self.bits() } @@ -335,12 +297,14 @@ impl IntoGlib for RepoPruneFlags { #[doc(hidden)] impl FromGlib for RepoPruneFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeRepoPruneFlags) -> Self { Self::from_bits_truncate(value) } } bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeRepoPullFlags")] pub struct RepoPullFlags: u32 { #[doc(alias = "OSTREE_REPO_PULL_FLAGS_NONE")] @@ -358,16 +322,11 @@ bitflags! { } } -impl fmt::Display for RepoPullFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - #[doc(hidden)] impl IntoGlib for RepoPullFlags { type GlibType = ffi::OstreeRepoPullFlags; + #[inline] fn into_glib(self) -> ffi::OstreeRepoPullFlags { self.bits() } @@ -375,12 +334,14 @@ impl IntoGlib for RepoPullFlags { #[doc(hidden)] impl FromGlib for RepoPullFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeRepoPullFlags) -> Self { Self::from_bits_truncate(value) } } bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeRepoResolveRevExtFlags")] pub struct RepoResolveRevExtFlags: u32 { #[doc(alias = "OSTREE_REPO_RESOLVE_REV_EXT_NONE")] @@ -390,16 +351,11 @@ bitflags! { } } -impl fmt::Display for RepoResolveRevExtFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - #[doc(hidden)] impl IntoGlib for RepoResolveRevExtFlags { type GlibType = ffi::OstreeRepoResolveRevExtFlags; + #[inline] fn into_glib(self) -> ffi::OstreeRepoResolveRevExtFlags { self.bits() } @@ -407,14 +363,16 @@ impl IntoGlib for RepoResolveRevExtFlags { #[doc(hidden)] impl FromGlib for RepoResolveRevExtFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeRepoResolveRevExtFlags) -> Self { Self::from_bits_truncate(value) } } -#[cfg(any(feature = "v2021_4", feature = "dox"))] +#[cfg(feature = "v2021_4")] bitflags! { - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_4")))] + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeRepoVerifyFlags")] pub struct RepoVerifyFlags: u32 { #[doc(alias = "OSTREE_REPO_VERIFY_FLAGS_NONE")] @@ -426,35 +384,30 @@ bitflags! { } } -#[cfg(any(feature = "v2021_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))] -impl fmt::Display for RepoVerifyFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - -#[cfg(any(feature = "v2021_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))] +#[cfg(feature = "v2021_4")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2021_4")))] #[doc(hidden)] impl IntoGlib for RepoVerifyFlags { type GlibType = ffi::OstreeRepoVerifyFlags; + #[inline] fn into_glib(self) -> ffi::OstreeRepoVerifyFlags { self.bits() } } -#[cfg(any(feature = "v2021_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))] +#[cfg(feature = "v2021_4")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2021_4")))] #[doc(hidden)] impl FromGlib for RepoVerifyFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeRepoVerifyFlags) -> Self { Self::from_bits_truncate(value) } } bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeSePolicyRestoreconFlags")] pub struct SePolicyRestoreconFlags: u32 { #[doc(alias = "OSTREE_SEPOLICY_RESTORECON_FLAGS_NONE")] @@ -466,16 +419,11 @@ bitflags! { } } -impl fmt::Display for SePolicyRestoreconFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - #[doc(hidden)] impl IntoGlib for SePolicyRestoreconFlags { type GlibType = ffi::OstreeSePolicyRestoreconFlags; + #[inline] fn into_glib(self) -> ffi::OstreeSePolicyRestoreconFlags { self.bits() } @@ -483,12 +431,14 @@ impl IntoGlib for SePolicyRestoreconFlags { #[doc(hidden)] impl FromGlib for SePolicyRestoreconFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeSePolicyRestoreconFlags) -> Self { Self::from_bits_truncate(value) } } bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeSysrootSimpleWriteDeploymentFlags")] pub struct SysrootSimpleWriteDeploymentFlags: u32 { #[doc(alias = "OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NONE")] @@ -506,16 +456,11 @@ bitflags! { } } -impl fmt::Display for SysrootSimpleWriteDeploymentFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - #[doc(hidden)] impl IntoGlib for SysrootSimpleWriteDeploymentFlags { type GlibType = ffi::OstreeSysrootSimpleWriteDeploymentFlags; + #[inline] fn into_glib(self) -> ffi::OstreeSysrootSimpleWriteDeploymentFlags { self.bits() } @@ -523,12 +468,14 @@ impl IntoGlib for SysrootSimpleWriteDeploymentFlags { #[doc(hidden)] impl FromGlib for SysrootSimpleWriteDeploymentFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeSysrootSimpleWriteDeploymentFlags) -> Self { Self::from_bits_truncate(value) } } bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeSysrootUpgraderFlags")] pub struct SysrootUpgraderFlags: u32 { #[doc(alias = "OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED")] @@ -538,16 +485,11 @@ bitflags! { } } -impl fmt::Display for SysrootUpgraderFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - #[doc(hidden)] impl IntoGlib for SysrootUpgraderFlags { type GlibType = ffi::OstreeSysrootUpgraderFlags; + #[inline] fn into_glib(self) -> ffi::OstreeSysrootUpgraderFlags { self.bits() } @@ -555,30 +497,45 @@ impl IntoGlib for SysrootUpgraderFlags { #[doc(hidden)] impl FromGlib for SysrootUpgraderFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeSysrootUpgraderFlags) -> Self { Self::from_bits_truncate(value) } } impl StaticType for SysrootUpgraderFlags { - fn static_type() -> Type { - unsafe { from_glib(ffi::ostree_sysroot_upgrader_flags_get_type()) } - } + #[inline] + #[doc(alias = "ostree_sysroot_upgrader_flags_get_type")] + fn static_type() -> glib::Type { + unsafe { from_glib(ffi::ostree_sysroot_upgrader_flags_get_type()) } + } + } + +impl glib::HasParamSpec for SysrootUpgraderFlags { + type ParamSpec = glib::ParamSpecFlags; + type SetValue = Self; + type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder; + + fn param_spec_builder() -> Self::BuilderFn { + Self::ParamSpec::builder + } } impl glib::value::ValueType for SysrootUpgraderFlags { type Type = Self; } -unsafe impl<'a> FromValue<'a> for SysrootUpgraderFlags { +unsafe impl<'a> glib::value::FromValue<'a> for SysrootUpgraderFlags { type Checker = glib::value::GenericValueTypeChecker; + #[inline] unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) } } impl ToValue for SysrootUpgraderFlags { + #[inline] fn to_value(&self) -> glib::Value { let mut value = glib::Value::for_value_type::(); unsafe { @@ -587,6 +544,7 @@ impl ToValue for SysrootUpgraderFlags { value } + #[inline] fn value_type(&self) -> glib::Type { Self::static_type() } @@ -600,6 +558,7 @@ impl From for glib::Value { } bitflags! { + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[doc(alias = "OstreeSysrootUpgraderPullFlags")] pub struct SysrootUpgraderPullFlags: u32 { #[doc(alias = "OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_NONE")] @@ -611,16 +570,11 @@ bitflags! { } } -impl fmt::Display for SysrootUpgraderPullFlags { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - ::fmt(self, f) - } -} - #[doc(hidden)] impl IntoGlib for SysrootUpgraderPullFlags { type GlibType = ffi::OstreeSysrootUpgraderPullFlags; + #[inline] fn into_glib(self) -> ffi::OstreeSysrootUpgraderPullFlags { self.bits() } @@ -628,6 +582,7 @@ impl IntoGlib for SysrootUpgraderPullFlags { #[doc(hidden)] impl FromGlib for SysrootUpgraderPullFlags { + #[inline] unsafe fn from_glib(value: ffi::OstreeSysrootUpgraderPullFlags) -> Self { Self::from_bits_truncate(value) } diff --git a/rust-bindings/src/auto/functions.rs b/rust-bindings/src/auto/functions.rs index 56c40835c2..d92e06f28a 100644 --- a/rust-bindings/src/auto/functions.rs +++ b/rust-bindings/src/auto/functions.rs @@ -2,32 +2,27 @@ // from gir-files // DO NOT EDIT -#[cfg(any(feature = "v2020_1", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))] -use crate::CommitSizesEntry; -use crate::DiffFlags; -use crate::DiffItem; -use crate::ObjectType; -use glib::object::IsA; -use glib::translate::*; -use std::mem; -use std::ptr; - - -#[cfg(any(feature = "v2017_15", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_15")))] +use crate::{DiffFlags,DiffItem,ObjectType}; +#[cfg(feature = "v2020_1")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))] +use crate::{CommitSizesEntry}; +use glib::{prelude::*,translate::*}; + + +#[cfg(feature = "v2017_15")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_15")))] #[doc(alias = "ostree_break_hardlink")] pub fn break_hardlink(dfd: i32, path: &str, skip_xattrs: bool, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_break_hardlink(dfd, path.to_glib_none().0, skip_xattrs.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } -#[cfg(any(feature = "v2017_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))] +#[cfg(feature = "v2017_4")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_4")))] #[doc(alias = "ostree_check_version")] pub fn check_version(required_year: u32, required_release: u32) -> bool { unsafe { @@ -59,8 +54,8 @@ pub fn checksum_to_bytes_v(checksum: &str) -> glib::Variant { } } -#[cfg(any(feature = "v2018_2", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))] +#[cfg(feature = "v2018_2")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_2")))] #[doc(alias = "ostree_commit_get_content_checksum")] pub fn commit_get_content_checksum(commit_variant: &glib::Variant) -> Option { unsafe { @@ -68,15 +63,15 @@ pub fn commit_get_content_checksum(commit_variant: &glib::Variant) -> Option Result, glib::Error> { unsafe { - let mut out_sizes_entries = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_sizes_entries = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_commit_get_object_sizes(commit_variant.to_glib_none().0, &mut out_sizes_entries, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(FromGlibPtrContainer::from_glib_container(out_sizes_entries)) } else { Err(from_glib_full(error)) } } } @@ -88,8 +83,8 @@ pub fn commit_get_parent(commit_variant: &glib::Variant) -> Option u64 { unsafe { @@ -97,8 +92,8 @@ pub fn commit_get_timestamp(commit_variant: &glib::Variant) -> u64 { } } -//#[cfg(any(feature = "v2021_1", feature = "dox"))] -//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))] +//#[cfg(feature = "v2021_1")] +//#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))] //#[doc(alias = "ostree_commit_metadata_for_bootable")] //pub fn commit_metadata_for_bootable(root: &impl IsA, dict: /*Ignored*/&glib::VariantDict, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_commit_metadata_for_bootable() } @@ -107,12 +102,12 @@ pub fn commit_get_timestamp(commit_variant: &glib::Variant) -> u64 { #[doc(alias = "ostree_content_file_parse")] pub fn content_file_parse(compressed: bool, content_path: &impl IsA, trusted: bool, cancellable: Option<&impl IsA>) -> 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(); - let mut out_xattrs = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_input = std::ptr::null_mut(); + let mut out_file_info = std::ptr::null_mut(); + let mut out_xattrs = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_content_file_parse(compressed.into_glib(), content_path.as_ref().to_glib_none().0, trusted.into_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok((from_glib_full(out_input), from_glib_full(out_file_info), from_glib_full(out_xattrs))) } else { Err(from_glib_full(error)) } } } @@ -120,12 +115,12 @@ pub fn content_file_parse(compressed: bool, content_path: &impl IsA, #[doc(alias = "ostree_content_file_parse_at")] pub fn content_file_parse_at(compressed: bool, parent_dfd: i32, path: &str, trusted: bool, cancellable: Option<&impl IsA>) -> 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(); - let mut out_xattrs = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_input = std::ptr::null_mut(); + let mut out_file_info = std::ptr::null_mut(); + let mut out_xattrs = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_content_file_parse_at(compressed.into_glib(), parent_dfd, path.to_glib_none().0, trusted.into_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok((from_glib_full(out_input), from_glib_full(out_file_info), from_glib_full(out_xattrs))) } else { Err(from_glib_full(error)) } } } @@ -133,12 +128,12 @@ pub fn content_file_parse_at(compressed: bool, parent_dfd: i32, path: &str, trus #[doc(alias = "ostree_content_stream_parse")] pub fn content_stream_parse(compressed: bool, input: &impl IsA, input_length: u64, trusted: bool, cancellable: Option<&impl IsA>) -> 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(); - let mut out_xattrs = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_input = std::ptr::null_mut(); + let mut out_file_info = std::ptr::null_mut(); + let mut out_xattrs = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_content_stream_parse(compressed.into_glib(), input.as_ref().to_glib_none().0, input_length, trusted.into_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok((from_glib_full(out_input), from_glib_full(out_file_info), from_glib_full(out_xattrs))) } else { Err(from_glib_full(error)) } } } @@ -153,15 +148,15 @@ pub fn create_directory_metadata(dir_info: &gio::FileInfo, xattrs: Option<&glib: #[doc(alias = "ostree_diff_dirs")] pub fn diff_dirs(flags: DiffFlags, a: &impl IsA, b: &impl IsA, modified: &[&DiffItem], removed: &[gio::File], added: &[gio::File], cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_diff_dirs(flags.into_glib(), a.as_ref().to_glib_none().0, b.as_ref().to_glib_none().0, modified.to_glib_none().0, removed.to_glib_none().0, added.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } -//#[cfg(any(feature = "v2017_4", feature = "dox"))] -//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))] +//#[cfg(feature = "v2017_4")] +//#[cfg_attr(docsrs, doc(cfg(feature = "v2017_4")))] //#[doc(alias = "ostree_diff_dirs_with_options")] //pub fn diff_dirs_with_options(flags: DiffFlags, a: &impl IsA, b: &impl IsA, modified: &[&DiffItem], removed: &[gio::File], added: &[gio::File], options: /*Ignored*/Option<&mut DiffDirsOptions>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_diff_dirs_with_options() } @@ -177,7 +172,7 @@ pub fn diff_print(a: &impl IsA, b: &impl IsA, modified: &[ #[doc(alias = "ostree_fs_get_all_xattrs")] pub fn fs_get_all_xattrs(fd: i32, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_fs_get_all_xattrs(fd, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } @@ -186,14 +181,14 @@ pub fn fs_get_all_xattrs(fd: i32, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_fs_get_all_xattrs_at(dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } -#[cfg(any(feature = "v2017_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))] +#[cfg(feature = "v2017_10")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_10")))] #[doc(alias = "ostree_gpg_error_quark")] pub fn gpg_error_quark() -> glib::Quark { unsafe { @@ -211,8 +206,8 @@ pub fn metadata_variant_type(objtype: ObjectType) -> glib::VariantType { #[doc(alias = "ostree_object_from_string")] pub fn object_from_string(str: &str) -> (glib::GString, ObjectType) { unsafe { - let mut out_checksum = ptr::null_mut(); - let mut out_objtype = mem::MaybeUninit::uninit(); + let mut out_checksum = std::ptr::null_mut(); + let mut out_objtype = std::mem::MaybeUninit::uninit(); ffi::ostree_object_from_string(str.to_glib_none().0, &mut out_checksum, out_objtype.as_mut_ptr()); (from_glib_full(out_checksum), from_glib(out_objtype.assume_init())) } @@ -221,8 +216,8 @@ pub fn object_from_string(str: &str) -> (glib::GString, ObjectType) { #[doc(alias = "ostree_object_name_deserialize")] pub fn object_name_deserialize(variant: &glib::Variant) -> (glib::GString, ObjectType) { unsafe { - let mut out_checksum = ptr::null(); - let mut out_objtype = mem::MaybeUninit::uninit(); + let mut out_checksum = std::ptr::null(); + let mut out_objtype = std::mem::MaybeUninit::uninit(); ffi::ostree_object_name_deserialize(variant.to_glib_none().0, &mut out_checksum, out_objtype.as_mut_ptr()); (from_glib_none(out_checksum), from_glib(out_objtype.assume_init())) } @@ -259,37 +254,37 @@ pub fn object_type_to_string(objtype: ObjectType) -> glib::GString { #[doc(alias = "ostree_parse_refspec")] pub fn parse_refspec(refspec: &str) -> Result<(Option, glib::GString), glib::Error> { unsafe { - let mut out_remote = ptr::null_mut(); - let mut out_ref = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_remote = std::ptr::null_mut(); + let mut out_ref = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_parse_refspec(refspec.to_glib_none().0, &mut out_remote, &mut out_ref, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok((from_glib_full(out_remote), from_glib_full(out_ref))) } else { Err(from_glib_full(error)) } } } -#[cfg(any(feature = "v2016_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_6")))] +#[cfg(feature = "v2016_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2016_6")))] #[doc(alias = "ostree_raw_file_to_archive_z2_stream")] pub fn raw_file_to_archive_z2_stream(input: &impl IsA, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_input = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_input = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_raw_file_to_archive_z2_stream(input.as_ref().to_glib_none().0, file_info.to_glib_none().0, xattrs.to_glib_none().0, &mut out_input, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_input)) } else { Err(from_glib_full(error)) } } } -#[cfg(any(feature = "v2017_3", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_3")))] +#[cfg(feature = "v2017_3")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_3")))] #[doc(alias = "ostree_raw_file_to_archive_z2_stream_with_options")] pub fn raw_file_to_archive_z2_stream_with_options(input: &impl IsA, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, options: Option<&glib::Variant>, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_input = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_input = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_raw_file_to_archive_z2_stream_with_options(input.as_ref().to_glib_none().0, file_info.to_glib_none().0, xattrs.to_glib_none().0, options.to_glib_none().0, &mut out_input, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_input)) } else { Err(from_glib_full(error)) } } } @@ -297,11 +292,11 @@ pub fn raw_file_to_archive_z2_stream_with_options(input: &impl IsA, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, cancellable: Option<&impl IsA>) -> Result<(gio::InputStream, u64), glib::Error> { unsafe { - let mut out_input = ptr::null_mut(); - let mut out_length = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_input = std::ptr::null_mut(); + let mut out_length = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_raw_file_to_content_stream(input.as_ref().to_glib_none().0, file_info.to_glib_none().0, xattrs.to_glib_none().0, &mut out_input, out_length.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok((from_glib_full(out_input), out_length.assume_init())) } else { Err(from_glib_full(error)) } } } @@ -309,33 +304,33 @@ pub fn raw_file_to_content_stream(input: &impl IsA, file_info: #[doc(alias = "ostree_validate_checksum_string")] pub fn validate_checksum_string(sha256: &str) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_validate_checksum_string(sha256.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "ostree_validate_collection_id")] pub fn validate_collection_id(collection_id: Option<&str>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_validate_collection_id(collection_id.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } -#[cfg(any(feature = "v2017_8", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_8")))] +#[cfg(feature = "v2017_8")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_8")))] #[doc(alias = "ostree_validate_remote_name")] pub fn validate_remote_name(remote_name: &str) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_validate_remote_name(remote_name.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -343,9 +338,9 @@ pub fn validate_remote_name(remote_name: &str) -> Result<(), glib::Error> { #[doc(alias = "ostree_validate_rev")] pub fn validate_rev(rev: &str) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_validate_rev(rev.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -353,9 +348,9 @@ pub fn validate_rev(rev: &str) -> Result<(), glib::Error> { #[doc(alias = "ostree_validate_structureof_checksum_string")] pub fn validate_structureof_checksum_string(checksum: &str) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_validate_structureof_checksum_string(checksum.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -363,9 +358,9 @@ pub fn validate_structureof_checksum_string(checksum: &str) -> Result<(), glib:: #[doc(alias = "ostree_validate_structureof_commit")] pub fn validate_structureof_commit(commit: &glib::Variant) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_validate_structureof_commit(commit.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -373,9 +368,9 @@ pub fn validate_structureof_commit(commit: &glib::Variant) -> Result<(), glib::E #[doc(alias = "ostree_validate_structureof_csum_v")] pub fn validate_structureof_csum_v(checksum: &glib::Variant) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_validate_structureof_csum_v(checksum.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -383,9 +378,9 @@ pub fn validate_structureof_csum_v(checksum: &glib::Variant) -> Result<(), glib: #[doc(alias = "ostree_validate_structureof_dirmeta")] pub fn validate_structureof_dirmeta(dirmeta: &glib::Variant) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_validate_structureof_dirmeta(dirmeta.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -393,9 +388,9 @@ pub fn validate_structureof_dirmeta(dirmeta: &glib::Variant) -> Result<(), glib: #[doc(alias = "ostree_validate_structureof_dirtree")] pub fn validate_structureof_dirtree(dirtree: &glib::Variant) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_validate_structureof_dirtree(dirtree.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -403,9 +398,9 @@ pub fn validate_structureof_dirtree(dirtree: &glib::Variant) -> Result<(), glib: #[doc(alias = "ostree_validate_structureof_file_mode")] pub fn validate_structureof_file_mode(mode: u32) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_validate_structureof_file_mode(mode, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -413,9 +408,9 @@ pub fn validate_structureof_file_mode(mode: u32) -> Result<(), glib::Error> { #[doc(alias = "ostree_validate_structureof_objtype")] pub fn validate_structureof_objtype(objtype: u8) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_validate_structureof_objtype(objtype, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } diff --git a/rust-bindings/src/auto/gpg_verify_result.rs b/rust-bindings/src/auto/gpg_verify_result.rs index 869d51716a..d0f21fd7a0 100644 --- a/rust-bindings/src/auto/gpg_verify_result.rs +++ b/rust-bindings/src/auto/gpg_verify_result.rs @@ -2,12 +2,7 @@ // from gir-files // DO NOT EDIT -use glib::translate::*; -use std::fmt; -use std::mem; -#[cfg(any(feature = "v2016_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_6")))] -use std::ptr; +use glib::{translate::*}; glib::wrapper! { #[doc(alias = "OstreeGpgVerifyResult")] @@ -49,27 +44,21 @@ impl GpgVerifyResult { #[doc(alias = "ostree_gpg_verify_result_lookup")] pub fn lookup(&self, key_id: &str) -> Option { unsafe { - let mut out_signature_index = mem::MaybeUninit::uninit(); + let mut out_signature_index = std::mem::MaybeUninit::uninit(); let ret = from_glib(ffi::ostree_gpg_verify_result_lookup(self.to_glib_none().0, key_id.to_glib_none().0, out_signature_index.as_mut_ptr())); if ret { Some(out_signature_index.assume_init()) } else { None } } } - #[cfg(any(feature = "v2016_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_6")))] + #[cfg(feature = "v2016_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_6")))] #[doc(alias = "ostree_gpg_verify_result_require_valid_signature")] pub fn require_valid_signature(&self) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_gpg_verify_result_require_valid_signature(self.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } } - -impl fmt::Display for GpgVerifyResult { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("GpgVerifyResult") - } -} diff --git a/rust-bindings/src/auto/mod.rs b/rust-bindings/src/auto/mod.rs index 39b6448c4a..d9305546b9 100644 --- a/rust-bindings/src/auto/mod.rs +++ b/rust-bindings/src/auto/mod.rs @@ -53,28 +53,28 @@ pub use self::sysroot::Sysroot; mod sysroot_upgrader; pub use self::sysroot_upgrader::SysrootUpgrader; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] mod collection_ref; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub use self::collection_ref::CollectionRef; -#[cfg(any(feature = "v2020_1", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))] +#[cfg(feature = "v2020_1")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))] mod commit_sizes_entry; -#[cfg(any(feature = "v2020_1", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))] +#[cfg(feature = "v2020_1")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))] pub use self::commit_sizes_entry::CommitSizesEntry; mod diff_item; pub use self::diff_item::DiffItem; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] mod remote; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub use self::remote::Remote; mod repo_commit_modifier; @@ -83,19 +83,19 @@ pub use self::repo_commit_modifier::RepoCommitModifier; mod repo_dev_ino_cache; pub use self::repo_dev_ino_cache::RepoDevInoCache; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] mod repo_finder_result; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub use self::repo_finder_result::RepoFinderResult; mod enums; pub use self::enums::DeploymentUnlockedState; pub use self::enums::GpgSignatureAttr; pub use self::enums::ObjectType; -#[cfg(any(feature = "v2018_2", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))] +#[cfg(feature = "v2018_2")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_2")))] pub use self::enums::RepoCheckoutFilterResult; pub use self::enums::RepoCheckoutMode; pub use self::enums::RepoCheckoutOverwriteMode; @@ -106,14 +106,14 @@ pub use self::enums::RepoRemoteChange; pub use self::enums::StaticDeltaGenerateOpt; mod flags; -#[cfg(any(feature = "v2017_13", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))] +#[cfg(feature = "v2017_13")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))] pub use self::flags::ChecksumFlags; pub use self::flags::DiffFlags; pub use self::flags::GpgSignatureFormatFlags; pub use self::flags::RepoCommitModifierFlags; -#[cfg(any(feature = "v2015_7", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))] +#[cfg(feature = "v2015_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2015_7")))] pub use self::flags::RepoCommitState; pub use self::flags::RepoCommitTraverseFlags; pub use self::flags::RepoListObjectsFlags; @@ -121,69 +121,68 @@ pub use self::flags::RepoListRefsExtFlags; pub use self::flags::RepoPruneFlags; pub use self::flags::RepoPullFlags; pub use self::flags::RepoResolveRevExtFlags; -#[cfg(any(feature = "v2021_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))] +#[cfg(feature = "v2021_4")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2021_4")))] pub use self::flags::RepoVerifyFlags; pub use self::flags::SePolicyRestoreconFlags; pub use self::flags::SysrootSimpleWriteDeploymentFlags; pub use self::flags::SysrootUpgraderFlags; pub use self::flags::SysrootUpgraderPullFlags; -pub mod functions; +pub(crate) mod functions; mod constants; pub use self::constants::COMMIT_GVARIANT_STRING; -#[cfg(any(feature = "v2020_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))] +#[cfg(feature = "v2020_4")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))] pub use self::constants::COMMIT_META_KEY_ARCHITECTURE; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub use self::constants::COMMIT_META_KEY_COLLECTION_BINDING; -#[cfg(any(feature = "v2017_7", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))] +#[cfg(feature = "v2017_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))] pub use self::constants::COMMIT_META_KEY_ENDOFLIFE; -#[cfg(any(feature = "v2017_7", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))] +#[cfg(feature = "v2017_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))] pub use self::constants::COMMIT_META_KEY_ENDOFLIFE_REBASE; -#[cfg(any(feature = "v2017_9", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_9")))] +#[cfg(feature = "v2017_9")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_9")))] pub use self::constants::COMMIT_META_KEY_REF_BINDING; -#[cfg(any(feature = "v2017_13", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))] +#[cfg(feature = "v2017_13")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))] pub use self::constants::COMMIT_META_KEY_SOURCE_TITLE; -#[cfg(any(feature = "v2014_9", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2014_9")))] +#[cfg(feature = "v2014_9")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2014_9")))] pub use self::constants::COMMIT_META_KEY_VERSION; pub use self::constants::DIRMETA_GVARIANT_STRING; pub use self::constants::FILEMETA_GVARIANT_STRING; pub use self::constants::GPG_KEY_GVARIANT_STRING; -#[cfg(any(feature = "v2021_1", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))] +#[cfg(feature = "v2021_1")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))] pub use self::constants::METADATA_KEY_BOOTABLE; -#[cfg(any(feature = "v2021_1", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))] +#[cfg(feature = "v2021_1")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))] pub use self::constants::METADATA_KEY_LINUX; -#[cfg(any(feature = "v2018_9", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_9")))] +#[cfg(feature = "v2018_9")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_9")))] pub use self::constants::META_KEY_DEPLOY_COLLECTION_ID; -#[cfg(any(feature = "v2018_3", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))] +#[cfg(feature = "v2018_3")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))] pub use self::constants::ORIGIN_TRANSIENT_GROUP; -#[cfg(any(feature = "v2022_2", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2022_2")))] +#[cfg(feature = "v2022_2")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2022_2")))] pub use self::constants::PATH_BOOTED; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub use self::constants::REPO_METADATA_REF; -#[cfg(any(feature = "v2020_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))] +#[cfg(feature = "v2020_4")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))] pub use self::constants::SIGN_NAME_ED25519; pub use self::constants::SUMMARY_GVARIANT_STRING; pub use self::constants::SUMMARY_SIG_GVARIANT_STRING; pub use self::constants::TREE_GVARIANT_STRING; -#[doc(hidden)] -pub mod traits { +pub(crate) mod traits { pub use super::repo_finder::RepoFinderExt; pub use super::sign::SignExt; } diff --git a/rust-bindings/src/auto/mutable_tree.rs b/rust-bindings/src/auto/mutable_tree.rs index 628adf2e22..43639fdf3d 100644 --- a/rust-bindings/src/auto/mutable_tree.rs +++ b/rust-bindings/src/auto/mutable_tree.rs @@ -2,12 +2,10 @@ // from gir-files // DO NOT EDIT -#[cfg(any(feature = "v2018_7", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_7")))] -use crate::Repo; -use glib::translate::*; -use std::fmt; -use std::ptr; +#[cfg(feature = "v2018_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_7")))] +use crate::{Repo}; +use glib::{translate::*}; glib::wrapper! { #[doc(alias = "OstreeMutableTree")] @@ -26,8 +24,8 @@ impl MutableTree { } } - #[cfg(any(feature = "v2018_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_7")))] + #[cfg(feature = "v2018_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_7")))] #[doc(alias = "ostree_mutable_tree_new_from_checksum")] #[doc(alias = "new_from_checksum")] pub fn from_checksum(repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> MutableTree { @@ -36,26 +34,26 @@ impl MutableTree { } } - #[cfg(any(feature = "v2021_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_5")))] + #[cfg(feature = "v2021_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_5")))] #[doc(alias = "ostree_mutable_tree_new_from_commit")] #[doc(alias = "new_from_commit")] pub fn from_commit(repo: &Repo, rev: &str) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_mutable_tree_new_from_commit(repo.to_glib_none().0, rev.to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2018_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_7")))] + #[cfg(feature = "v2018_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_7")))] #[doc(alias = "ostree_mutable_tree_check_error")] pub fn check_error(&self) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_mutable_tree_check_error(self.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -63,10 +61,10 @@ impl MutableTree { #[doc(alias = "ostree_mutable_tree_ensure_dir")] pub fn ensure_dir(&self, name: &str) -> Result { unsafe { - let mut out_subdir = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_subdir = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_mutable_tree_ensure_dir(self.to_glib_none().0, name.to_glib_none().0, &mut out_subdir, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_subdir)) } else { Err(from_glib_full(error)) } } } @@ -74,16 +72,16 @@ impl MutableTree { #[doc(alias = "ostree_mutable_tree_ensure_parent_dirs")] pub fn ensure_parent_dirs(&self, split_path: &[&str], metadata_checksum: &str) -> Result { unsafe { - let mut out_parent = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_parent = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_mutable_tree_ensure_parent_dirs(self.to_glib_none().0, split_path.to_glib_none().0, metadata_checksum.to_glib_none().0, &mut out_parent, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_parent)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2018_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_7")))] + #[cfg(feature = "v2018_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_7")))] #[doc(alias = "ostree_mutable_tree_fill_empty_from_dirtree")] pub fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool { unsafe { @@ -122,23 +120,23 @@ impl MutableTree { #[doc(alias = "ostree_mutable_tree_lookup")] pub fn lookup(&self, name: &str) -> Result<(Option, Option), glib::Error> { unsafe { - let mut out_file_checksum = ptr::null_mut(); - let mut out_subdir = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_file_checksum = std::ptr::null_mut(); + let mut out_subdir = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_mutable_tree_lookup(self.to_glib_none().0, name.to_glib_none().0, &mut out_file_checksum, &mut out_subdir, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok((from_glib_full(out_file_checksum), from_glib_full(out_subdir))) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2018_9", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_9")))] + #[cfg(feature = "v2018_9")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_9")))] #[doc(alias = "ostree_mutable_tree_remove")] pub fn remove(&self, name: &str, allow_noent: bool) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_mutable_tree_remove(self.to_glib_none().0, name.to_glib_none().0, allow_noent.into_glib(), &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -146,9 +144,9 @@ impl MutableTree { #[doc(alias = "ostree_mutable_tree_replace_file")] pub fn replace_file(&self, name: &str, checksum: &str) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_mutable_tree_replace_file(self.to_glib_none().0, name.to_glib_none().0, checksum.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -170,10 +168,10 @@ impl MutableTree { #[doc(alias = "ostree_mutable_tree_walk")] pub fn walk(&self, split_path: &[&str], start: u32) -> Result { unsafe { - let mut out_subdir = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_subdir = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_mutable_tree_walk(self.to_glib_none().0, split_path.to_glib_none().0, start, &mut out_subdir, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_subdir)) } else { Err(from_glib_full(error)) } } } @@ -184,9 +182,3 @@ impl Default for MutableTree { Self::new() } } - -impl fmt::Display for MutableTree { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("MutableTree") - } -} diff --git a/rust-bindings/src/auto/remote.rs b/rust-bindings/src/auto/remote.rs index d0925ae894..b01e8cb269 100644 --- a/rust-bindings/src/auto/remote.rs +++ b/rust-bindings/src/auto/remote.rs @@ -2,8 +2,7 @@ // from gir-files // DO NOT EDIT -use glib::translate::*; -use std::fmt; +use glib::{translate::*}; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -34,9 +33,9 @@ impl Remote { } } -impl fmt::Display for Remote { +impl std::fmt::Display for Remote { #[inline] - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.write_str(&self.name()) } } diff --git a/rust-bindings/src/auto/repo.rs b/rust-bindings/src/auto/repo.rs index 2210c2c6eb..d6dd186c71 100644 --- a/rust-bindings/src/auto/repo.rs +++ b/rust-bindings/src/auto/repo.rs @@ -2,58 +2,30 @@ // from gir-files // DO NOT EDIT -use crate::AsyncProgress; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] -use crate::CollectionRef; -#[cfg(any(feature = "v2021_2", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_2")))] -use crate::ContentWriter; -use crate::GpgVerifyResult; -use crate::MutableTree; -use crate::ObjectType; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] -use crate::Remote; -#[cfg(any(feature = "v2016_8", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_8")))] -use crate::RepoCheckoutAtOptions; -use crate::RepoCheckoutMode; -use crate::RepoCheckoutOverwriteMode; -use crate::RepoCommitModifier; -#[cfg(any(feature = "v2015_7", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))] -use crate::RepoCommitState; -use crate::RepoFile; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] -use crate::RepoFinderResult; -use crate::RepoMode; -use crate::RepoPruneFlags; -use crate::RepoPullFlags; -use crate::RepoRemoteChange; -#[cfg(any(feature = "v2016_7", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_7")))] -use crate::RepoResolveRevExtFlags; -use crate::RepoTransactionStats; -#[cfg(any(feature = "v2021_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))] -use crate::RepoVerifyFlags; -#[cfg(any(feature = "v2020_7", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] -use crate::Sign; -use crate::StaticDeltaGenerateOpt; -use glib::object::IsA; -use glib::object::ObjectType as ObjectType_; -use glib::signal::connect_raw; -use glib::signal::SignalHandlerId; -use glib::translate::*; -use glib::StaticType; -use std::boxed::Box as Box_; -use std::fmt; -use std::mem; -use std::mem::transmute; -use std::ptr; +use crate::{AsyncProgress,GpgVerifyResult,MutableTree,ObjectType,RepoCheckoutMode,RepoCheckoutOverwriteMode,RepoCommitModifier,RepoFile,RepoMode,RepoPruneFlags,RepoPullFlags,RepoRemoteChange,RepoTransactionStats,StaticDeltaGenerateOpt}; +#[cfg(feature = "v2015_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2015_7")))] +use crate::{RepoCommitState}; +#[cfg(feature = "v2016_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2016_7")))] +use crate::{RepoResolveRevExtFlags}; +#[cfg(feature = "v2016_8")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2016_8")))] +use crate::{RepoCheckoutAtOptions}; +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] +use crate::{CollectionRef,Remote,RepoFinderResult}; +#[cfg(feature = "v2020_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] +use crate::{Sign}; +#[cfg(feature = "v2021_2")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2021_2")))] +use crate::{ContentWriter}; +#[cfg(feature = "v2021_4")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2021_4")))] +use crate::{RepoVerifyFlags}; +use glib::{object::ObjectType as _, prelude::*, signal::{connect_raw, SignalHandlerId}, translate::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[doc(alias = "OstreeRepo")] @@ -90,9 +62,9 @@ impl Repo { #[doc(alias = "ostree_repo_abort_transaction")] pub fn abort_transaction(&self, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_abort_transaction(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -100,9 +72,9 @@ impl Repo { #[doc(alias = "ostree_repo_add_gpg_signature_summary")] pub fn add_gpg_signature_summary(&self, key_id: &[&str], homedir: Option<&str>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -110,21 +82,21 @@ impl Repo { #[doc(alias = "ostree_repo_append_gpg_signature")] pub fn append_gpg_signature(&self, commit_checksum: &str, signature_bytes: &glib::Bytes, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2016_8", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_8")))] + #[cfg(feature = "v2016_8")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_8")))] #[doc(alias = "ostree_repo_checkout_at")] pub fn checkout_at(&self, options: Option<&RepoCheckoutAtOptions>, destination_dfd: i32, destination_path: impl AsRef, commit: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -132,9 +104,9 @@ impl Repo { #[doc(alias = "ostree_repo_checkout_composefs")] pub fn checkout_composefs(&self, options: Option<&glib::Variant>, destination_dfd: i32, destination_path: &str, checksum: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_checkout_composefs(self.to_glib_none().0, options.to_glib_none().0, destination_dfd, destination_path.to_glib_none().0, checksum.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -142,9 +114,9 @@ impl Repo { #[doc(alias = "ostree_repo_checkout_gc")] pub fn checkout_gc(&self, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_checkout_gc(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -152,9 +124,9 @@ impl Repo { #[doc(alias = "ostree_repo_checkout_tree")] pub fn checkout_tree(&self, mode: RepoCheckoutMode, overwrite_mode: RepoCheckoutOverwriteMode, destination: &impl IsA, source: &RepoFile, source_info: &gio::FileInfo, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_checkout_tree(self.to_glib_none().0, mode.into_glib(), overwrite_mode.into_glib(), destination.as_ref().to_glib_none().0, source.to_glib_none().0, source_info.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -168,9 +140,9 @@ impl Repo { pub fn commit_transaction(&self, cancellable: Option<&impl IsA>) -> Result { unsafe { let mut out_stats = RepoTransactionStats::uninitialized(); - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_commit_transaction(self.to_glib_none().0, out_stats.to_glib_none_mut().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(out_stats) } else { Err(from_glib_full(error)) } } } @@ -185,9 +157,9 @@ impl Repo { #[doc(alias = "ostree_repo_create")] pub fn create(&self, mode: RepoMode, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_create(self.to_glib_none().0, mode.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -195,15 +167,15 @@ impl Repo { #[doc(alias = "ostree_repo_delete_object")] pub fn delete_object(&self, objtype: ObjectType, sha256: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_delete_object(self.to_glib_none().0, objtype.into_glib(), sha256.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2017_12", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_12")))] + #[cfg(feature = "v2017_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_12")))] #[doc(alias = "ostree_repo_equal")] pub fn equal(&self, b: &Repo) -> bool { unsafe { @@ -216,20 +188,20 @@ impl Repo { // unsafe { TODO: call ffi:ostree_repo_export_tree_to_archive() } //} - #[cfg(any(feature = "v2017_15", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_15")))] + #[cfg(feature = "v2017_15")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_15")))] #[doc(alias = "ostree_repo_fsck_object")] pub fn fsck_object(&self, objtype: ObjectType, sha256: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_fsck_object(self.to_glib_none().0, objtype.into_glib(), sha256.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2019_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_2")))] + #[cfg(feature = "v2019_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_2")))] #[doc(alias = "ostree_repo_get_bootloader")] #[doc(alias = "get_bootloader")] pub fn bootloader(&self) -> glib::GString { @@ -238,8 +210,8 @@ impl Repo { } } - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "ostree_repo_get_collection_id")] #[doc(alias = "get_collection_id")] pub fn collection_id(&self) -> Option { @@ -256,8 +228,8 @@ impl Repo { } } - #[cfg(any(feature = "v2018_9", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_9")))] + #[cfg(feature = "v2018_9")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_9")))] #[doc(alias = "ostree_repo_get_default_repo_finders")] #[doc(alias = "get_default_repo_finders")] pub fn default_repo_finders(&self) -> Vec { @@ -266,8 +238,8 @@ impl Repo { } } - #[cfg(any(feature = "v2016_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] + #[cfg(feature = "v2016_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] #[doc(alias = "ostree_repo_get_dfd")] #[doc(alias = "get_dfd")] pub fn dfd(&self) -> i32 { @@ -284,16 +256,16 @@ impl Repo { } } - #[cfg(any(feature = "v2018_9", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_9")))] + #[cfg(feature = "v2018_9")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_9")))] #[doc(alias = "ostree_repo_get_min_free_space_bytes")] #[doc(alias = "get_min_free_space_bytes")] pub fn min_free_space_bytes(&self) -> Result { unsafe { - let mut out_reserved_bytes = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_reserved_bytes = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_get_min_free_space_bytes(self.to_glib_none().0, out_reserved_bytes.as_mut_ptr(), &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(out_reserved_bytes.assume_init()) } else { Err(from_glib_full(error)) } } } @@ -323,67 +295,67 @@ impl Repo { } } - #[cfg(any(feature = "v2016_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))] + #[cfg(feature = "v2016_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] #[doc(alias = "ostree_repo_get_remote_boolean_option")] #[doc(alias = "get_remote_boolean_option")] pub fn remote_boolean_option(&self, remote_name: &str, option_name: &str, default_value: bool) -> Result { unsafe { - let mut out_value = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_value = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_get_remote_boolean_option(self.to_glib_none().0, remote_name.to_glib_none().0, option_name.to_glib_none().0, default_value.into_glib(), out_value.as_mut_ptr(), &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib(out_value.assume_init())) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2016_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))] + #[cfg(feature = "v2016_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] #[doc(alias = "ostree_repo_get_remote_list_option")] #[doc(alias = "get_remote_list_option")] pub fn remote_list_option(&self, remote_name: &str, option_name: &str) -> Result, glib::Error> { unsafe { - let mut out_value = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_value = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_get_remote_list_option(self.to_glib_none().0, remote_name.to_glib_none().0, option_name.to_glib_none().0, &mut out_value, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(FromGlibPtrContainer::from_glib_full(out_value)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2016_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))] + #[cfg(feature = "v2016_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] #[doc(alias = "ostree_repo_get_remote_option")] #[doc(alias = "get_remote_option")] pub fn remote_option(&self, remote_name: &str, option_name: &str, default_value: Option<&str>) -> Result, glib::Error> { unsafe { - let mut out_value = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_value = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_get_remote_option(self.to_glib_none().0, remote_name.to_glib_none().0, option_name.to_glib_none().0, default_value.to_glib_none().0, &mut out_value, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_value)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_8", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_8")))] + #[cfg(feature = "v2020_8")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_8")))] #[doc(alias = "ostree_repo_gpg_sign_data")] pub fn gpg_sign_data(&self, data: &glib::Bytes, old_signatures: Option<&glib::Bytes>, key_id: &[&str], homedir: Option<&str>, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_signatures = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_signatures = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_gpg_sign_data(self.to_glib_none().0, data.to_glib_none().0, old_signatures.to_glib_none().0, key_id.to_glib_none().0, homedir.to_glib_none().0, &mut out_signatures, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_signatures)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2016_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_6")))] + #[cfg(feature = "v2016_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_6")))] #[doc(alias = "ostree_repo_gpg_verify_data")] pub fn gpg_verify_data(&self, remote_name: Option<&str>, data: &glib::Bytes, signatures: &glib::Bytes, keyringdir: Option<&impl IsA>, extra_keyring: Option<&impl IsA>, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::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); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } @@ -392,16 +364,16 @@ impl Repo { #[doc(alias = "ostree_repo_has_object")] pub fn has_object(&self, objtype: ObjectType, checksum: &str, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_have_object = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_have_object = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_has_object(self.to_glib_none().0, objtype.into_glib(), checksum.to_glib_none().0, out_have_object.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib(out_have_object.assume_init())) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2017_12", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_12")))] + #[cfg(feature = "v2017_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_12")))] #[doc(alias = "ostree_repo_hash")] pub fn hash(&self) -> u32 { unsafe { @@ -417,21 +389,21 @@ impl Repo { #[doc(alias = "ostree_repo_import_object_from")] pub fn import_object_from(&self, source: &Repo, objtype: ObjectType, checksum: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_import_object_from(self.to_glib_none().0, source.to_glib_none().0, objtype.into_glib(), checksum.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2016_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))] + #[cfg(feature = "v2016_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] #[doc(alias = "ostree_repo_import_object_from_with_trust")] pub fn import_object_from_with_trust(&self, source: &Repo, objtype: ObjectType, checksum: &str, trusted: bool, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_import_object_from_with_trust(self.to_glib_none().0, source.to_glib_none().0, objtype.into_glib(), checksum.to_glib_none().0, trusted.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -446,22 +418,22 @@ impl Repo { #[doc(alias = "ostree_repo_is_writable")] pub fn is_writable(&self) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_is_writable(self.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + //#[cfg(feature = "v2018_6")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] //#[doc(alias = "ostree_repo_list_collection_refs")] //pub fn list_collection_refs(&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<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_list_collection_refs() } //} //#[doc(alias = "ostree_repo_list_objects")] - //pub fn list_objects(&self, flags: RepoListObjectsFlags, out_objects: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 204 }/TypeId { ns_id: 2, id: 204 }, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { + //pub fn list_objects(&self, flags: RepoListObjectsFlags, out_objects: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 222 }/TypeId { ns_id: 2, id: 222 }, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_list_objects() } //} @@ -470,22 +442,22 @@ impl Repo { // unsafe { TODO: call ffi:ostree_repo_list_refs() } //} - //#[cfg(any(feature = "v2016_4", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] + //#[cfg(feature = "v2016_4")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] //#[doc(alias = "ostree_repo_list_refs_ext")] //pub fn list_refs_ext(&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<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_list_refs_ext() } //} - #[cfg(any(feature = "v2020_8", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_8")))] + #[cfg(feature = "v2020_8")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_8")))] #[doc(alias = "ostree_repo_list_static_delta_indexes")] pub fn list_static_delta_indexes(&self, cancellable: Option<&impl IsA>) -> Result, glib::Error> { unsafe { - let mut out_indexes = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_indexes = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_list_static_delta_indexes(self.to_glib_none().0, &mut out_indexes, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(FromGlibPtrContainer::from_glib_container(out_indexes)) } else { Err(from_glib_full(error)) } } } @@ -493,24 +465,24 @@ impl Repo { #[doc(alias = "ostree_repo_list_static_delta_names")] pub fn list_static_delta_names(&self, cancellable: Option<&impl IsA>) -> Result, glib::Error> { unsafe { - let mut out_deltas = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_deltas = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_list_static_delta_names(self.to_glib_none().0, &mut out_deltas, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(FromGlibPtrContainer::from_glib_container(out_deltas)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2015_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))] + #[cfg(feature = "v2015_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2015_7")))] #[doc(alias = "ostree_repo_load_commit")] 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(); - let mut error = ptr::null_mut(); + let mut out_commit = std::ptr::null_mut(); + let mut out_state = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_load_commit(self.to_glib_none().0, checksum.to_glib_none().0, &mut out_commit, out_state.as_mut_ptr(), &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok((from_glib_full(out_commit), from_glib(out_state.assume_init()))) } else { Err(from_glib_full(error)) } } } @@ -518,11 +490,11 @@ impl Repo { #[doc(alias = "ostree_repo_load_object_stream")] pub fn load_object_stream(&self, objtype: ObjectType, checksum: &str, cancellable: Option<&impl IsA>) -> Result<(gio::InputStream, u64), glib::Error> { unsafe { - let mut out_input = ptr::null_mut(); - let mut out_size = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_input = std::ptr::null_mut(); + let mut out_size = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_load_object_stream(self.to_glib_none().0, objtype.into_glib(), checksum.to_glib_none().0, &mut out_input, out_size.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok((from_glib_full(out_input), out_size.assume_init())) } else { Err(from_glib_full(error)) } } } @@ -530,10 +502,10 @@ impl Repo { #[doc(alias = "ostree_repo_load_variant")] pub fn load_variant(&self, objtype: ObjectType, sha256: &str) -> Result { unsafe { - let mut out_variant = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_variant = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_load_variant(self.to_glib_none().0, objtype.into_glib(), sha256.to_glib_none().0, &mut out_variant, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_variant)) } else { Err(from_glib_full(error)) } } } @@ -541,48 +513,48 @@ impl Repo { #[doc(alias = "ostree_repo_load_variant_if_exists")] pub fn load_variant_if_exists(&self, objtype: ObjectType, sha256: &str) -> Result, glib::Error> { unsafe { - let mut out_variant = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_variant = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_load_variant_if_exists(self.to_glib_none().0, objtype.into_glib(), sha256.to_glib_none().0, &mut out_variant, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_variant)) } else { Err(from_glib_full(error)) } } } - //#[cfg(any(feature = "v2021_3", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_3")))] + //#[cfg(feature = "v2021_3")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2021_3")))] //#[doc(alias = "ostree_repo_lock_pop")] //pub fn lock_pop(&self, lock_type: /*Ignored*/RepoLockType, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_lock_pop() } //} - //#[cfg(any(feature = "v2021_3", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_3")))] + //#[cfg(feature = "v2021_3")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2021_3")))] //#[doc(alias = "ostree_repo_lock_push")] //pub fn lock_push(&self, lock_type: /*Ignored*/RepoLockType, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_lock_push() } //} - #[cfg(any(feature = "v2017_15", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_15")))] + #[cfg(feature = "v2017_15")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_15")))] #[doc(alias = "ostree_repo_mark_commit_partial")] pub fn mark_commit_partial(&self, checksum: &str, is_partial: bool) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_mark_commit_partial(self.to_glib_none().0, checksum.to_glib_none().0, is_partial.into_glib(), &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2019_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_4")))] + #[cfg(feature = "v2019_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_4")))] #[doc(alias = "ostree_repo_mark_commit_partial_reason")] 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 mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_mark_commit_partial_reason(self.to_glib_none().0, checksum.to_glib_none().0, is_partial.into_glib(), in_state.into_glib(), &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -590,9 +562,9 @@ impl Repo { #[doc(alias = "ostree_repo_open")] pub fn open(&self, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_open(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -600,10 +572,10 @@ impl Repo { #[doc(alias = "ostree_repo_prepare_transaction")] pub fn prepare_transaction(&self, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_transaction_resume = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_transaction_resume = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_prepare_transaction(self.to_glib_none().0, out_transaction_resume.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib(out_transaction_resume.assume_init())) } else { Err(from_glib_full(error)) } } } @@ -611,18 +583,18 @@ impl Repo { #[doc(alias = "ostree_repo_prune")] pub fn prune(&self, flags: RepoPruneFlags, depth: i32, cancellable: Option<&impl IsA>) -> Result<(i32, i32, u64), glib::Error> { unsafe { - let mut out_objects_total = mem::MaybeUninit::uninit(); - let mut out_objects_pruned = mem::MaybeUninit::uninit(); - let mut out_pruned_object_size_total = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_objects_total = std::mem::MaybeUninit::uninit(); + let mut out_objects_pruned = std::mem::MaybeUninit::uninit(); + let mut out_pruned_object_size_total = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_prune(self.to_glib_none().0, flags.into_glib(), depth, out_objects_total.as_mut_ptr(), out_objects_pruned.as_mut_ptr(), out_pruned_object_size_total.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok((out_objects_total.assume_init(), out_objects_pruned.assume_init(), out_pruned_object_size_total.assume_init())) } else { Err(from_glib_full(error)) } } } - //#[cfg(any(feature = "v2017_1", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_1")))] + //#[cfg(feature = "v2017_1")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2017_1")))] //#[doc(alias = "ostree_repo_prune_from_reachable")] //pub fn prune_from_reachable(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: Option<&impl IsA>) -> Result<(i32, i32, u64), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_prune_from_reachable() } @@ -631,9 +603,9 @@ impl Repo { #[doc(alias = "ostree_repo_prune_static_deltas")] pub fn prune_static_deltas(&self, commit: Option<&str>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -641,9 +613,9 @@ impl Repo { #[doc(alias = "ostree_repo_pull")] pub fn pull(&self, remote_name: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: Option<&AsyncProgress>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_pull(self.to_glib_none().0, remote_name.to_glib_none().0, refs_to_fetch.to_glib_none().0, flags.into_glib(), progress.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -651,9 +623,9 @@ impl Repo { #[doc(alias = "ostree_repo_pull_one_dir")] pub fn pull_one_dir(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: Option<&AsyncProgress>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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.into_glib(), progress.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -661,9 +633,9 @@ impl Repo { #[doc(alias = "ostree_repo_pull_with_options")] pub fn pull_with_options(&self, remote_name_or_baseurl: &str, options: &glib::Variant, progress: Option<&AsyncProgress>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_pull_with_options(self.to_glib_none().0, remote_name_or_baseurl.to_glib_none().0, options.to_glib_none().0, progress.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -671,10 +643,10 @@ impl Repo { #[doc(alias = "ostree_repo_query_object_storage_size")] pub fn query_object_storage_size(&self, objtype: ObjectType, sha256: &str, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_size = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_size = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_query_object_storage_size(self.to_glib_none().0, objtype.into_glib(), sha256.to_glib_none().0, out_size.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(out_size.assume_init()) } else { Err(from_glib_full(error)) } } } @@ -682,11 +654,11 @@ impl Repo { #[doc(alias = "ostree_repo_read_commit")] pub fn read_commit(&self, ref_: &str, cancellable: Option<&impl IsA>) -> Result<(gio::File, glib::GString), glib::Error> { unsafe { - let mut out_root = ptr::null_mut(); - let mut out_commit = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_root = std::ptr::null_mut(); + let mut out_commit = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_read_commit(self.to_glib_none().0, ref_.to_glib_none().0, &mut out_root, &mut out_commit, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok((from_glib_full(out_root), from_glib_full(out_commit))) } else { Err(from_glib_full(error)) } } } @@ -694,22 +666,22 @@ impl Repo { #[doc(alias = "ostree_repo_read_commit_detached_metadata")] pub fn read_commit_detached_metadata(&self, checksum: &str, cancellable: Option<&impl IsA>) -> Result, glib::Error> { unsafe { - let mut out_metadata = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_metadata = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_read_commit_detached_metadata(self.to_glib_none().0, checksum.to_glib_none().0, &mut out_metadata, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_metadata)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2023_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2023_1")))] + #[cfg(feature = "v2023_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2023_1")))] #[doc(alias = "ostree_repo_regenerate_metadata")] pub fn regenerate_metadata(&self, additional_metadata: Option<&glib::Variant>, options: Option<&glib::Variant>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_regenerate_metadata(self.to_glib_none().0, additional_metadata.to_glib_none().0, options.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -717,21 +689,21 @@ impl Repo { #[doc(alias = "ostree_repo_regenerate_summary")] pub fn regenerate_summary(&self, additional_metadata: Option<&glib::Variant>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2017_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_2")))] + #[cfg(feature = "v2017_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_2")))] #[doc(alias = "ostree_repo_reload_config")] pub fn reload_config(&self, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_reload_config(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -739,9 +711,9 @@ impl Repo { #[doc(alias = "ostree_repo_remote_add")] pub fn remote_add(&self, name: &str, url: Option<&str>, options: Option<&glib::Variant>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -749,9 +721,9 @@ impl Repo { #[doc(alias = "ostree_repo_remote_change")] pub fn remote_change(&self, sysroot: Option<&impl IsA>, changeop: RepoRemoteChange, name: &str, url: Option<&str>, options: Option<&glib::Variant>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_remote_change(self.to_glib_none().0, sysroot.map(|p| p.as_ref()).to_glib_none().0, changeop.into_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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -759,9 +731,9 @@ impl Repo { #[doc(alias = "ostree_repo_remote_delete")] pub fn remote_delete(&self, name: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -769,38 +741,38 @@ impl Repo { #[doc(alias = "ostree_repo_remote_fetch_summary")] pub fn remote_fetch_summary(&self, name: &str, cancellable: Option<&impl IsA>) -> Result<(glib::Bytes, glib::Bytes), glib::Error> { unsafe { - let mut out_summary = ptr::null_mut(); - let mut out_signatures = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_summary = std::ptr::null_mut(); + let mut out_signatures = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_remote_fetch_summary(self.to_glib_none().0, name.to_glib_none().0, &mut out_summary, &mut out_signatures, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok((from_glib_full(out_summary), from_glib_full(out_signatures))) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2016_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_6")))] + #[cfg(feature = "v2016_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_6")))] #[doc(alias = "ostree_repo_remote_fetch_summary_with_options")] pub fn remote_fetch_summary_with_options(&self, name: &str, options: Option<&glib::Variant>, cancellable: Option<&impl IsA>) -> Result<(glib::Bytes, glib::Bytes), glib::Error> { unsafe { - let mut out_summary = ptr::null_mut(); - let mut out_signatures = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_summary = std::ptr::null_mut(); + let mut out_signatures = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_remote_fetch_summary_with_options(self.to_glib_none().0, name.to_glib_none().0, options.to_glib_none().0, &mut out_summary, &mut out_signatures, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok((from_glib_full(out_summary), from_glib_full(out_signatures))) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2021_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))] + #[cfg(feature = "v2021_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_4")))] #[doc(alias = "ostree_repo_remote_get_gpg_keys")] pub fn remote_get_gpg_keys(&self, name: Option<&str>, key_ids: &[&str], cancellable: Option<&impl IsA>) -> Result, glib::Error> { unsafe { - let mut out_keys = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_keys = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_remote_get_gpg_keys(self.to_glib_none().0, name.to_glib_none().0, key_ids.to_glib_none().0, &mut out_keys, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(FromGlibPtrContainer::from_glib_container(out_keys)) } else { Err(from_glib_full(error)) } } } @@ -808,10 +780,10 @@ impl Repo { #[doc(alias = "ostree_repo_remote_get_gpg_verify")] pub fn remote_get_gpg_verify(&self, name: &str) -> Result { unsafe { - let mut out_gpg_verify = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_gpg_verify = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_remote_get_gpg_verify(self.to_glib_none().0, name.to_glib_none().0, out_gpg_verify.as_mut_ptr(), &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib(out_gpg_verify.assume_init())) } else { Err(from_glib_full(error)) } } } @@ -819,10 +791,10 @@ impl Repo { #[doc(alias = "ostree_repo_remote_get_gpg_verify_summary")] pub fn remote_get_gpg_verify_summary(&self, name: &str) -> Result { unsafe { - let mut out_gpg_verify_summary = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_gpg_verify_summary = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_remote_get_gpg_verify_summary(self.to_glib_none().0, name.to_glib_none().0, out_gpg_verify_summary.as_mut_ptr(), &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib(out_gpg_verify_summary.assume_init())) } else { Err(from_glib_full(error)) } } } @@ -830,10 +802,10 @@ impl Repo { #[doc(alias = "ostree_repo_remote_get_url")] pub fn remote_get_url(&self, name: &str) -> Result { unsafe { - let mut out_url = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_url = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_remote_get_url(self.to_glib_none().0, name.to_glib_none().0, &mut out_url, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_url)) } else { Err(from_glib_full(error)) } } } @@ -841,10 +813,10 @@ impl Repo { #[doc(alias = "ostree_repo_remote_gpg_import")] pub fn remote_gpg_import(&self, name: &str, source_stream: Option<&impl IsA>, key_ids: &[&str], cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_imported = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_imported = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_remote_gpg_import(self.to_glib_none().0, name.to_glib_none().0, source_stream.map(|p| p.as_ref()).to_glib_none().0, key_ids.to_glib_none().0, out_imported.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(out_imported.assume_init()) } else { Err(from_glib_full(error)) } } } @@ -852,14 +824,14 @@ impl Repo { #[doc(alias = "ostree_repo_remote_list")] pub fn remote_list(&self) -> Vec { unsafe { - let mut out_n_remotes = mem::MaybeUninit::uninit(); + let mut out_n_remotes = std::mem::MaybeUninit::uninit(); let ret = FromGlibContainer::from_glib_full_num(ffi::ostree_repo_remote_list(self.to_glib_none().0, out_n_remotes.as_mut_ptr()), out_n_remotes.assume_init() as _); ret } } - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + //#[cfg(feature = "v2018_6")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] //#[doc(alias = "ostree_repo_remote_list_collection_refs")] //pub fn remote_list_collection_refs(&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<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_remote_list_collection_refs() } @@ -870,25 +842,25 @@ impl Repo { // unsafe { TODO: call ffi:ostree_repo_remote_list_refs() } //} - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "ostree_repo_resolve_collection_ref")] pub fn resolve_collection_ref(&self, ref_: &CollectionRef, allow_noent: bool, flags: RepoResolveRevExtFlags, cancellable: Option<&impl IsA>) -> Result, glib::Error> { unsafe { - let mut out_rev = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_rev = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_resolve_collection_ref(self.to_glib_none().0, ref_.to_glib_none().0, allow_noent.into_glib(), flags.into_glib(), &mut out_rev, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_rev)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "ostree_repo_resolve_keyring_for_collection")] pub fn resolve_keyring_for_collection(&self, collection_id: &str, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::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); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } @@ -897,23 +869,23 @@ impl Repo { #[doc(alias = "ostree_repo_resolve_rev")] pub fn resolve_rev(&self, refspec: &str, allow_noent: bool) -> Result, glib::Error> { unsafe { - let mut out_rev = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_rev = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_resolve_rev(self.to_glib_none().0, refspec.to_glib_none().0, allow_noent.into_glib(), &mut out_rev, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_rev)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2016_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_7")))] + #[cfg(feature = "v2016_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_7")))] #[doc(alias = "ostree_repo_resolve_rev_ext")] pub fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: RepoResolveRevExtFlags) -> Result, glib::Error> { unsafe { - let mut out_rev = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_rev = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_resolve_rev_ext(self.to_glib_none().0, refspec.to_glib_none().0, allow_noent.into_glib(), flags.into_glib(), &mut out_rev, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_rev)) } else { Err(from_glib_full(error)) } } } @@ -921,57 +893,57 @@ impl Repo { #[doc(alias = "ostree_repo_scan_hardlinks")] pub fn scan_hardlinks(&self, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_scan_hardlinks(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2017_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))] + #[cfg(feature = "v2017_10")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_10")))] #[doc(alias = "ostree_repo_set_alias_ref_immediate")] pub fn set_alias_ref_immediate(&self, remote: Option<&str>, ref_: &str, target: Option<&str>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2016_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))] + #[cfg(feature = "v2016_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] #[doc(alias = "ostree_repo_set_cache_dir")] pub fn set_cache_dir(&self, dfd: i32, path: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "ostree_repo_set_collection_id")] pub fn set_collection_id(&self, collection_id: Option<&str>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_set_collection_id(self.to_glib_none().0, collection_id.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "ostree_repo_set_collection_ref_immediate")] pub fn set_collection_ref_immediate(&self, ref_: &CollectionRef, checksum: Option<&str>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -986,9 +958,9 @@ impl Repo { #[doc(alias = "ostree_repo_set_ref_immediate")] pub fn set_ref_immediate(&self, remote: Option<&str>, ref_: &str, checksum: Option<&str>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -996,9 +968,9 @@ impl Repo { #[doc(alias = "ostree_repo_sign_commit")] pub fn sign_commit(&self, commit_checksum: &str, key_id: &str, homedir: Option<&str>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -1006,22 +978,22 @@ impl Repo { #[doc(alias = "ostree_repo_sign_delta")] pub fn sign_delta(&self, from_commit: &str, to_commit: &str, key_id: &str, homedir: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2021_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))] + #[cfg(feature = "v2021_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_4")))] #[doc(alias = "ostree_repo_signature_verify_commit_data")] pub fn signature_verify_commit_data(&self, remote_name: &str, commit_data: &glib::Bytes, commit_metadata: &glib::Bytes, flags: RepoVerifyFlags) -> Result { unsafe { - let mut out_results = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_results = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_signature_verify_commit_data(self.to_glib_none().0, remote_name.to_glib_none().0, commit_data.to_glib_none().0, commit_metadata.to_glib_none().0, flags.into_glib(), &mut out_results, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_results)) } else { Err(from_glib_full(error)) } } } @@ -1029,21 +1001,21 @@ impl Repo { #[doc(alias = "ostree_repo_static_delta_execute_offline")] pub fn static_delta_execute_offline(&self, dir_or_file: &impl IsA, skip_validation: bool, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_static_delta_execute_offline(self.to_glib_none().0, dir_or_file.as_ref().to_glib_none().0, skip_validation.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] + #[cfg(feature = "v2020_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] #[doc(alias = "ostree_repo_static_delta_execute_offline_with_signature")] pub fn static_delta_execute_offline_with_signature(&self, dir_or_file: &impl IsA, sign: &impl IsA, skip_validation: bool, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_static_delta_execute_offline_with_signature(self.to_glib_none().0, dir_or_file.as_ref().to_glib_none().0, sign.as_ref().to_glib_none().0, skip_validation.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -1051,35 +1023,35 @@ impl Repo { #[doc(alias = "ostree_repo_static_delta_generate")] pub fn static_delta_generate(&self, opt: StaticDeltaGenerateOpt, from: Option<&str>, to: &str, metadata: Option<&glib::Variant>, params: Option<&glib::Variant>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_static_delta_generate(self.to_glib_none().0, opt.into_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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - //#[cfg(any(feature = "v2020_8", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_8")))] + //#[cfg(feature = "v2020_8")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2020_8")))] //#[doc(alias = "ostree_repo_static_delta_reindex")] //pub fn static_delta_reindex(&self, flags: /*Ignored*/StaticDeltaIndexFlags, opt_to_commit: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_static_delta_reindex() } //} - #[cfg(any(feature = "v2020_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] + #[cfg(feature = "v2020_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] #[doc(alias = "ostree_repo_static_delta_verify_signature")] pub fn static_delta_verify_signature(&self, delta_id: &str, sign: &impl IsA) -> Result, glib::Error> { unsafe { - let mut out_success_message = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_success_message = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_static_delta_verify_signature(self.to_glib_none().0, delta_id.to_glib_none().0, sign.as_ref().to_glib_none().0, &mut out_success_message, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_success_message)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "ostree_repo_transaction_set_collection_ref")] pub fn transaction_set_collection_ref(&self, ref_: &CollectionRef, checksum: Option<&str>) { unsafe { @@ -1102,7 +1074,7 @@ impl Repo { } //#[doc(alias = "ostree_repo_traverse_commit")] - //pub fn traverse_commit(&self, commit_checksum: &str, maxdepth: i32, out_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 204 }/TypeId { ns_id: 2, id: 204 }, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { + //pub fn traverse_commit(&self, commit_checksum: &str, maxdepth: i32, out_reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 222 }/TypeId { ns_id: 2, id: 222 }, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_traverse_commit() } //} @@ -1111,33 +1083,33 @@ impl Repo { // unsafe { TODO: call ffi:ostree_repo_traverse_commit_union() } //} - //#[cfg(any(feature = "v2018_5", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] + //#[cfg(feature = "v2018_5")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))] //#[doc(alias = "ostree_repo_traverse_commit_union_with_parents")] //pub fn traverse_commit_union_with_parents(&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<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_traverse_commit_union_with_parents() } //} - //#[cfg(any(feature = "v2018_5", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] + //#[cfg(feature = "v2018_5")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))] //#[doc(alias = "ostree_repo_traverse_commit_with_flags")] //pub fn traverse_commit_with_flags(&self, flags: RepoCommitTraverseFlags, 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<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_traverse_commit_with_flags() } //} - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + //#[cfg(feature = "v2018_6")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] //#[doc(alias = "ostree_repo_traverse_reachable_refs")] - //pub fn traverse_reachable_refs(&self, depth: u32, reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 204 }/TypeId { ns_id: 2, id: 204 }, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { + //pub fn traverse_reachable_refs(&self, depth: u32, reachable: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 222 }/TypeId { ns_id: 2, id: 222 }, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { // unsafe { TODO: call ffi:ostree_repo_traverse_reachable_refs() } //} #[doc(alias = "ostree_repo_verify_commit")] pub fn verify_commit(&self, commit_checksum: &str, keyringdir: Option<&impl IsA>, extra_keyring: Option<&impl IsA>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -1145,18 +1117,18 @@ impl Repo { #[doc(alias = "ostree_repo_verify_commit_ext")] pub fn verify_commit_ext(&self, commit_checksum: &str, keyringdir: Option<&impl IsA>, extra_keyring: Option<&impl IsA>, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::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); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2016_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_14")))] + #[cfg(feature = "v2016_14")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_14")))] #[doc(alias = "ostree_repo_verify_commit_for_remote")] pub fn verify_commit_for_remote(&self, commit_checksum: &str, remote_name: &str, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::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); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } @@ -1165,7 +1137,7 @@ impl Repo { #[doc(alias = "ostree_repo_verify_summary")] pub fn verify_summary(&self, remote_name: &str, summary: &glib::Bytes, signatures: &glib::Bytes, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::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); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } @@ -1174,9 +1146,9 @@ impl Repo { #[doc(alias = "ostree_repo_write_archive_to_mtree")] pub fn write_archive_to_mtree(&self, archive: &impl IsA, mtree: &MutableTree, modifier: Option<&RepoCommitModifier>, autocreate_parents: bool, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_write_archive_to_mtree(self.to_glib_none().0, archive.as_ref().to_glib_none().0, mtree.to_glib_none().0, modifier.to_glib_none().0, autocreate_parents.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -1184,9 +1156,9 @@ impl Repo { #[doc(alias = "ostree_repo_write_archive_to_mtree_from_fd")] pub fn write_archive_to_mtree_from_fd(&self, fd: i32, mtree: &MutableTree, modifier: Option<&RepoCommitModifier>, autocreate_parents: bool, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_write_archive_to_mtree_from_fd(self.to_glib_none().0, fd, mtree.to_glib_none().0, modifier.to_glib_none().0, autocreate_parents.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -1194,10 +1166,10 @@ impl Repo { #[doc(alias = "ostree_repo_write_commit")] pub fn write_commit(&self, parent: Option<&str>, subject: Option<&str>, body: Option<&str>, metadata: Option<&glib::Variant>, root: &RepoFile, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_commit = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_commit = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_write_commit(self.to_glib_none().0, parent.to_glib_none().0, subject.to_glib_none().0, body.to_glib_none().0, metadata.to_glib_none().0, root.to_glib_none().0, &mut out_commit, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_commit)) } else { Err(from_glib_full(error)) } } } @@ -1205,9 +1177,9 @@ impl Repo { #[doc(alias = "ostree_repo_write_commit_detached_metadata")] pub fn write_commit_detached_metadata(&self, checksum: &str, metadata: Option<&glib::Variant>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -1215,10 +1187,10 @@ impl Repo { #[doc(alias = "ostree_repo_write_commit_with_time")] pub fn write_commit_with_time(&self, parent: Option<&str>, subject: Option<&str>, body: Option<&str>, metadata: Option<&glib::Variant>, root: &RepoFile, time: u64, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_commit = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_commit = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_write_commit_with_time(self.to_glib_none().0, parent.to_glib_none().0, subject.to_glib_none().0, body.to_glib_none().0, metadata.to_glib_none().0, root.to_glib_none().0, time, &mut out_commit, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_commit)) } else { Err(from_glib_full(error)) } } } @@ -1226,9 +1198,9 @@ impl Repo { #[doc(alias = "ostree_repo_write_config")] pub fn write_config(&self, new_config: &glib::KeyFile) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_write_config(self.to_glib_none().0, new_config.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -1236,9 +1208,9 @@ impl Repo { #[doc(alias = "ostree_repo_write_content_trusted")] pub fn write_content_trusted(&self, checksum: &str, object_input: &impl IsA, length: u64, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -1246,9 +1218,9 @@ impl Repo { #[doc(alias = "ostree_repo_write_dfd_to_mtree")] pub fn write_dfd_to_mtree(&self, dfd: i32, path: &str, mtree: &MutableTree, modifier: Option<&RepoCommitModifier>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_write_dfd_to_mtree(self.to_glib_none().0, dfd, path.to_glib_none().0, mtree.to_glib_none().0, modifier.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -1256,9 +1228,9 @@ impl Repo { #[doc(alias = "ostree_repo_write_directory_to_mtree")] pub fn write_directory_to_mtree(&self, dir: &impl IsA, mtree: &MutableTree, modifier: Option<&RepoCommitModifier>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_write_directory_to_mtree(self.to_glib_none().0, dir.as_ref().to_glib_none().0, mtree.to_glib_none().0, modifier.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -1266,9 +1238,9 @@ impl Repo { #[doc(alias = "ostree_repo_write_metadata_stream_trusted")] pub fn write_metadata_stream_trusted(&self, objtype: ObjectType, checksum: &str, object_input: &impl IsA, length: u64, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_write_metadata_stream_trusted(self.to_glib_none().0, objtype.into_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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -1276,9 +1248,9 @@ impl Repo { #[doc(alias = "ostree_repo_write_metadata_trusted")] pub fn write_metadata_trusted(&self, objtype: ObjectType, checksum: &str, variant: &glib::Variant, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_write_metadata_trusted(self.to_glib_none().0, objtype.into_glib(), checksum.to_glib_none().0, variant.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -1286,43 +1258,43 @@ impl Repo { #[doc(alias = "ostree_repo_write_mtree")] pub fn write_mtree(&self, mtree: &MutableTree, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_file = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_file = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_write_mtree(self.to_glib_none().0, mtree.to_glib_none().0, &mut out_file, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_file)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2021_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_2")))] + #[cfg(feature = "v2021_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_2")))] #[doc(alias = "ostree_repo_write_regfile")] pub fn write_regfile(&self, expected_checksum: Option<&str>, uid: u32, gid: u32, mode: u32, content_len: u64, xattrs: Option<&glib::Variant>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_repo_write_regfile(self.to_glib_none().0, expected_checksum.to_glib_none().0, uid, gid, mode, content_len, xattrs.to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2021_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_2")))] + #[cfg(feature = "v2021_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_2")))] #[doc(alias = "ostree_repo_write_regfile_inline")] pub fn write_regfile_inline(&self, expected_checksum: Option<&str>, uid: u32, gid: u32, mode: u32, xattrs: Option<&glib::Variant>, buf: &[u8], cancellable: Option<&impl IsA>) -> Result { let len = buf.len() as _; unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_repo_write_regfile_inline(self.to_glib_none().0, expected_checksum.to_glib_none().0, uid, gid, mode, xattrs.to_glib_none().0, buf.to_glib_none().0, len, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2021_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_2")))] + #[cfg(feature = "v2021_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_2")))] #[doc(alias = "ostree_repo_write_symlink")] pub fn write_symlink(&self, expected_checksum: Option<&str>, uid: u32, gid: u32, xattrs: Option<&glib::Variant>, symlink_target: &str, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_repo_write_symlink(self.to_glib_none().0, expected_checksum.to_glib_none().0, uid, gid, xattrs.to_glib_none().0, symlink_target.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } @@ -1330,20 +1302,20 @@ impl Repo { #[doc(alias = "remotes-config-dir")] pub fn remotes_config_dir(&self) -> Option { - glib::ObjectExt::property(self, "remotes-config-dir") + ObjectExt::property(self, "remotes-config-dir") } #[doc(alias = "sysroot-path")] pub fn sysroot_path(&self) -> Option { - glib::ObjectExt::property(self, "sysroot-path") + ObjectExt::property(self, "sysroot-path") } - #[cfg(any(feature = "v2017_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))] + #[cfg(feature = "v2017_10")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_10")))] #[doc(alias = "ostree_repo_create_at")] pub fn create_at(dfd: i32, path: &str, mode: RepoMode, options: Option<&glib::Variant>, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_repo_create_at(dfd, path.to_glib_none().0, mode.into_glib(), options.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } @@ -1352,20 +1324,20 @@ impl Repo { #[doc(alias = "ostree_repo_mode_from_string")] pub fn mode_from_string(mode: &str) -> Result { unsafe { - let mut out_mode = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_mode = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_mode_from_string(mode.to_glib_none().0, out_mode.as_mut_ptr(), &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib(out_mode.assume_init())) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2017_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))] + #[cfg(feature = "v2017_10")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_10")))] #[doc(alias = "ostree_repo_open_at")] pub fn open_at(dfd: i32, path: &str, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_repo_open_at(dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } @@ -1376,20 +1348,20 @@ impl Repo { // unsafe { TODO: call ffi:ostree_repo_pull_default_console_progress_changed() } //} - //#[cfg(any(feature = "v2018_5", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] + //#[cfg(feature = "v2018_5")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))] //#[doc(alias = "ostree_repo_traverse_new_parents")] - //pub fn traverse_new_parents() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 204 }/TypeId { ns_id: 2, id: 204 } { + //pub fn traverse_new_parents() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 222 }/TypeId { ns_id: 2, id: 222 } { // unsafe { TODO: call ffi:ostree_repo_traverse_new_parents() } //} //#[doc(alias = "ostree_repo_traverse_new_reachable")] - //pub fn traverse_new_reachable() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 204 }/TypeId { ns_id: 2, id: 204 } { + //pub fn traverse_new_reachable() -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 2, id: 222 }/TypeId { ns_id: 2, id: 222 } { // unsafe { TODO: call ffi:ostree_repo_traverse_new_reachable() } //} - //#[cfg(any(feature = "v2018_5", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] + //#[cfg(feature = "v2018_5")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))] //#[doc(alias = "ostree_repo_traverse_parents_get_commits")] //pub fn traverse_parents_get_commits(parents: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 25 }/TypeId { ns_id: 0, id: 25 }, object: &glib::Variant) -> Vec { // unsafe { TODO: call ffi:ostree_repo_traverse_parents_get_commits() } @@ -1404,15 +1376,9 @@ impl Repo { unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"gpg-verify-result\0".as_ptr() as *const _, - Some(transmute::<_, unsafe extern "C" fn()>(gpg_verify_result_trampoline:: as *const ())), Box_::into_raw(f)) + Some(std::mem::transmute::<_, unsafe extern "C" fn()>(gpg_verify_result_trampoline:: as *const ())), Box_::into_raw(f)) } } } unsafe impl Send for Repo {} - -impl fmt::Display for Repo { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("Repo") - } -} diff --git a/rust-bindings/src/auto/repo_commit_modifier.rs b/rust-bindings/src/auto/repo_commit_modifier.rs index 7179c48b0e..fb98cbe44e 100644 --- a/rust-bindings/src/auto/repo_commit_modifier.rs +++ b/rust-bindings/src/auto/repo_commit_modifier.rs @@ -2,21 +2,15 @@ // from gir-files // DO NOT EDIT -use crate::Repo; -use crate::RepoCommitFilterResult; -use crate::RepoCommitModifierFlags; -#[cfg(any(feature = "v2017_13", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))] -use crate::RepoDevInoCache; -use crate::SePolicy; -#[cfg(any(feature = "v2020_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))] -use glib::object::IsA; -use glib::translate::*; -use std::boxed::Box as Box_; -#[cfg(any(feature = "v2020_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))] -use std::ptr; +use crate::{Repo,RepoCommitFilterResult,RepoCommitModifierFlags,SePolicy}; +#[cfg(feature = "v2017_13")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))] +use crate::{RepoDevInoCache}; +use glib::{translate::*}; +#[cfg(feature = "v2020_4")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))] +use glib::{prelude::*}; +use std::{boxed::Box as Box_}; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] @@ -37,17 +31,17 @@ impl RepoCommitModifier { let repo = from_glib_borrow(repo); let path: Borrowed = from_glib_borrow(path); let file_info = from_glib_borrow(file_info); - let callback: &Option RepoCommitFilterResult + 'static>> = &*(user_data as *mut _); - let res = if let Some(ref callback) = *callback { + let callback = &*(user_data as *mut Option RepoCommitFilterResult + 'static>>); + if let Some(ref callback) = *callback { callback(&repo, path.as_str(), &file_info) } else { panic!("cannot get closure...") - }; - res.into_glib() + } + .into_glib() } 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::ffi::gpointer) { - let _callback: Box_ RepoCommitFilterResult + 'static>>> = Box_::from_raw(data as *mut _); + let _callback = Box_::from_raw(data as *mut Option RepoCommitFilterResult + 'static>>); } let destroy_call3 = Some(destroy_notify_func as _); let super_callback0: Box_ RepoCommitFilterResult + 'static>>> = commit_filter_data; @@ -56,8 +50,8 @@ impl RepoCommitModifier { } } - #[cfg(any(feature = "v2017_13", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))] + #[cfg(feature = "v2017_13")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))] #[doc(alias = "ostree_repo_commit_modifier_set_devino_cache")] pub fn set_devino_cache(&self, cache: &RepoDevInoCache) { unsafe { @@ -72,14 +66,14 @@ impl RepoCommitModifier { } } - #[cfg(any(feature = "v2020_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))] + #[cfg(feature = "v2020_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))] #[doc(alias = "ostree_repo_commit_modifier_set_sepolicy_from_commit")] pub fn set_sepolicy_from_commit(&self, repo: &Repo, rev: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_commit_modifier_set_sepolicy_from_commit(self.to_glib_none().0, repo.to_glib_none().0, rev.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -91,13 +85,13 @@ impl RepoCommitModifier { let repo = from_glib_borrow(repo); let path: Borrowed = from_glib_borrow(path); let file_info = from_glib_borrow(file_info); - let callback: &P = &*(user_data as *mut _); - let res = (*callback)(&repo, path.as_str(), &file_info); - res.to_glib_full() + let callback = &*(user_data as *mut P); + (*callback)(&repo, path.as_str(), &file_info) + .to_glib_full() } let callback = Some(callback_func::

as _); unsafe extern "C" fn destroy_func glib::Variant + 'static>(data: glib::ffi::gpointer) { - let _callback: Box_

= Box_::from_raw(data as *mut _); + let _callback = Box_::from_raw(data as *mut P); } let destroy_call2 = Some(destroy_func::

as _); let super_callback0: Box_

= callback_data; diff --git a/rust-bindings/src/auto/repo_dev_ino_cache.rs b/rust-bindings/src/auto/repo_dev_ino_cache.rs index 1388147392..177b99f10f 100644 --- a/rust-bindings/src/auto/repo_dev_ino_cache.rs +++ b/rust-bindings/src/auto/repo_dev_ino_cache.rs @@ -2,7 +2,7 @@ // from gir-files // DO NOT EDIT -use glib::translate::*; +use glib::{translate::*}; glib::wrapper! { #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] diff --git a/rust-bindings/src/auto/repo_file.rs b/rust-bindings/src/auto/repo_file.rs index d480e76326..3edf3499fb 100644 --- a/rust-bindings/src/auto/repo_file.rs +++ b/rust-bindings/src/auto/repo_file.rs @@ -2,12 +2,8 @@ // from gir-files // DO NOT EDIT -use crate::Repo; -use glib::object::IsA; -use glib::translate::*; -use std::fmt; -use std::mem; -use std::ptr; +use crate::{Repo}; +use glib::{prelude::*,translate::*}; glib::wrapper! { #[doc(alias = "OstreeRepoFile")] @@ -22,9 +18,9 @@ impl RepoFile { #[doc(alias = "ostree_repo_file_ensure_resolved")] pub fn ensure_resolved(&self) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_file_ensure_resolved(self.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -58,10 +54,10 @@ impl RepoFile { #[doc(alias = "get_xattrs")] pub fn xattrs(&self, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_xattrs = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_xattrs = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_file_get_xattrs(self.to_glib_none().0, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_xattrs)) } else { Err(from_glib_full(error)) } } } @@ -69,8 +65,8 @@ impl RepoFile { #[doc(alias = "ostree_repo_file_tree_find_child")] pub fn tree_find_child(&self, name: &str) -> (i32, bool, glib::Variant) { unsafe { - let mut is_dir = mem::MaybeUninit::uninit(); - let mut out_container = ptr::null_mut(); + let mut is_dir = std::mem::MaybeUninit::uninit(); + let mut out_container = std::ptr::null_mut(); let ret = ffi::ostree_repo_file_tree_find_child(self.to_glib_none().0, name.to_glib_none().0, is_dir.as_mut_ptr(), &mut out_container); (ret, from_glib(is_dir.assume_init()), from_glib_full(out_container)) } @@ -107,10 +103,10 @@ impl RepoFile { #[doc(alias = "ostree_repo_file_tree_query_child")] pub fn tree_query_child(&self, n: i32, attributes: &str, flags: gio::FileQueryInfoFlags, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_info = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_info = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_repo_file_tree_query_child(self.to_glib_none().0, n, attributes.to_glib_none().0, flags.into_glib(), &mut out_info, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_info)) } else { Err(from_glib_full(error)) } } } @@ -122,9 +118,3 @@ impl RepoFile { } } } - -impl fmt::Display for RepoFile { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("RepoFile") - } -} diff --git a/rust-bindings/src/auto/repo_finder.rs b/rust-bindings/src/auto/repo_finder.rs index 6247a8d5ea..e0469637b9 100644 --- a/rust-bindings/src/auto/repo_finder.rs +++ b/rust-bindings/src/auto/repo_finder.rs @@ -2,17 +2,13 @@ // from gir-files // DO NOT EDIT -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] -use crate::RepoFinderResult; -use glib::object::IsA; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] -use glib::translate::*; -use std::fmt; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] -use std::ptr; +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] +use crate::{RepoFinderResult}; +use glib::{prelude::*}; +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] +use glib::{translate::*}; glib::wrapper! { #[doc(alias = "OstreeRepoFinder")] @@ -28,12 +24,11 @@ impl RepoFinder { } -pub trait RepoFinderExt: 'static {} +mod sealed { + pub trait Sealed {} + impl> Sealed for T {} +} -impl> RepoFinderExt for O {} +pub trait RepoFinderExt: IsA + sealed::Sealed + 'static {} -impl fmt::Display for RepoFinder { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("RepoFinder") - } -} +impl> RepoFinderExt for O {} diff --git a/rust-bindings/src/auto/repo_finder_avahi.rs b/rust-bindings/src/auto/repo_finder_avahi.rs index 46b2984181..06bba723ab 100644 --- a/rust-bindings/src/auto/repo_finder_avahi.rs +++ b/rust-bindings/src/auto/repo_finder_avahi.rs @@ -2,11 +2,10 @@ // from gir-files // DO NOT EDIT -use crate::RepoFinder; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] -use glib::translate::*; -use std::fmt; +use crate::{RepoFinder}; +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] +use glib::{translate::*}; glib::wrapper! { #[doc(alias = "OstreeRepoFinderAvahi")] @@ -18,8 +17,8 @@ glib::wrapper! { } impl RepoFinderAvahi { - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "ostree_repo_finder_avahi_new")] pub fn new(context: Option<&glib::MainContext>) -> RepoFinderAvahi { unsafe { @@ -27,8 +26,8 @@ impl RepoFinderAvahi { } } - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "ostree_repo_finder_avahi_stop")] pub fn stop(&self) { unsafe { @@ -36,9 +35,3 @@ impl RepoFinderAvahi { } } } - -impl fmt::Display for RepoFinderAvahi { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("RepoFinderAvahi") - } -} diff --git a/rust-bindings/src/auto/repo_finder_config.rs b/rust-bindings/src/auto/repo_finder_config.rs index a86401726c..b6f061d7ae 100644 --- a/rust-bindings/src/auto/repo_finder_config.rs +++ b/rust-bindings/src/auto/repo_finder_config.rs @@ -2,11 +2,10 @@ // from gir-files // DO NOT EDIT -use crate::RepoFinder; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] -use glib::translate::*; -use std::fmt; +use crate::{RepoFinder}; +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] +use glib::{translate::*}; glib::wrapper! { #[doc(alias = "OstreeRepoFinderConfig")] @@ -18,8 +17,8 @@ glib::wrapper! { } impl RepoFinderConfig { - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "ostree_repo_finder_config_new")] pub fn new() -> RepoFinderConfig { unsafe { @@ -28,16 +27,10 @@ impl RepoFinderConfig { } } -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] impl Default for RepoFinderConfig { fn default() -> Self { Self::new() } } - -impl fmt::Display for RepoFinderConfig { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("RepoFinderConfig") - } -} diff --git a/rust-bindings/src/auto/repo_finder_mount.rs b/rust-bindings/src/auto/repo_finder_mount.rs index b5d08472c7..cd5eac678b 100644 --- a/rust-bindings/src/auto/repo_finder_mount.rs +++ b/rust-bindings/src/auto/repo_finder_mount.rs @@ -2,20 +2,10 @@ // from gir-files // DO NOT EDIT -use crate::RepoFinder; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] -use glib::object::IsA; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] -use glib::object::ObjectType as ObjectType_; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] -use glib::translate::*; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] -use glib::StaticType; -use std::fmt; +use crate::{RepoFinder}; +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] +use glib::{prelude::*,translate::*}; glib::wrapper! { #[doc(alias = "OstreeRepoFinderMount")] @@ -27,8 +17,8 @@ glib::wrapper! { } impl RepoFinderMount { - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "ostree_repo_finder_mount_new")] pub fn new(monitor: Option<&impl IsA>) -> RepoFinderMount { unsafe { @@ -36,15 +26,9 @@ impl RepoFinderMount { } } - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn monitor(&self) -> Option { - glib::ObjectExt::property(self, "monitor") - } -} - -impl fmt::Display for RepoFinderMount { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("RepoFinderMount") + ObjectExt::property(self, "monitor") } } diff --git a/rust-bindings/src/auto/repo_finder_override.rs b/rust-bindings/src/auto/repo_finder_override.rs index 724c5a10fb..90f9c0d9f1 100644 --- a/rust-bindings/src/auto/repo_finder_override.rs +++ b/rust-bindings/src/auto/repo_finder_override.rs @@ -2,11 +2,10 @@ // from gir-files // DO NOT EDIT -use crate::RepoFinder; -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] -use glib::translate::*; -use std::fmt; +use crate::{RepoFinder}; +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] +use glib::{translate::*}; glib::wrapper! { #[doc(alias = "OstreeRepoFinderOverride")] @@ -18,8 +17,8 @@ glib::wrapper! { } impl RepoFinderOverride { - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "ostree_repo_finder_override_new")] pub fn new() -> RepoFinderOverride { unsafe { @@ -27,8 +26,8 @@ impl RepoFinderOverride { } } - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] #[doc(alias = "ostree_repo_finder_override_add_uri")] pub fn add_uri(&self, uri: &str) { unsafe { @@ -37,16 +36,10 @@ impl RepoFinderOverride { } } -#[cfg(any(feature = "v2018_6", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] +#[cfg(feature = "v2018_6")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] impl Default for RepoFinderOverride { fn default() -> Self { Self::new() } } - -impl fmt::Display for RepoFinderOverride { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("RepoFinderOverride") - } -} diff --git a/rust-bindings/src/auto/repo_finder_result.rs b/rust-bindings/src/auto/repo_finder_result.rs index 4908673e80..f84486c882 100644 --- a/rust-bindings/src/auto/repo_finder_result.rs +++ b/rust-bindings/src/auto/repo_finder_result.rs @@ -2,8 +2,7 @@ // from gir-files // DO NOT EDIT -use glib::translate::*; -use std::cmp; +use glib::{translate::*}; glib::wrapper! { #[derive(Debug, Hash)] @@ -41,14 +40,14 @@ impl Eq for RepoFinderResult {} impl PartialOrd for RepoFinderResult { #[inline] - fn partial_cmp(&self, other: &Self) -> Option { - self.compare(other).partial_cmp(&0) + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) } } impl Ord for RepoFinderResult { #[inline] - fn cmp(&self, other: &Self) -> cmp::Ordering { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { self.compare(other).cmp(&0) } } diff --git a/rust-bindings/src/auto/se_policy.rs b/rust-bindings/src/auto/se_policy.rs index beb5a1e07d..e270ed17d5 100644 --- a/rust-bindings/src/auto/se_policy.rs +++ b/rust-bindings/src/auto/se_policy.rs @@ -2,14 +2,8 @@ // from gir-files // DO NOT EDIT -use crate::Repo; -use crate::SePolicyRestoreconFlags; -use glib::object::IsA; -use glib::object::ObjectType as ObjectType_; -use glib::translate::*; -use glib::StaticType; -use std::fmt; -use std::ptr; +use crate::{Repo,SePolicyRestoreconFlags}; +use glib::{prelude::*,translate::*}; glib::wrapper! { #[doc(alias = "OstreeSePolicy")] @@ -24,18 +18,18 @@ impl SePolicy { #[doc(alias = "ostree_sepolicy_new")] pub fn new(path: &impl IsA, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_sepolicy_new(path.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2017_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))] + #[cfg(feature = "v2017_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_4")))] #[doc(alias = "ostree_sepolicy_new_at")] pub fn new_at(rootfs_dfd: i32, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_sepolicy_new_at(rootfs_dfd, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } @@ -45,14 +39,14 @@ impl SePolicy { #[doc(alias = "new_from_commit")] pub fn from_commit(repo: &Repo, rev: &str, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_sepolicy_new_from_commit(repo.to_glib_none().0, rev.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2016_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))] + #[cfg(feature = "v2016_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] #[doc(alias = "ostree_sepolicy_get_csum")] #[doc(alias = "get_csum")] pub fn csum(&self) -> Option { @@ -65,10 +59,10 @@ impl SePolicy { #[doc(alias = "get_label")] pub fn label(&self, relpath: &str, unix_mode: u32, cancellable: Option<&impl IsA>) -> Result, glib::Error> { unsafe { - let mut out_label = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_label = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sepolicy_get_label(self.to_glib_none().0, relpath.to_glib_none().0, unix_mode, &mut out_label, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_label)) } else { Err(from_glib_full(error)) } } } @@ -92,10 +86,10 @@ impl SePolicy { #[doc(alias = "ostree_sepolicy_restorecon")] pub fn restorecon(&self, path: &str, info: Option<&gio::FileInfo>, target: &impl IsA, flags: SePolicyRestoreconFlags, cancellable: Option<&impl IsA>) -> Result, glib::Error> { unsafe { - let mut out_new_label = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_new_label = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sepolicy_restorecon(self.to_glib_none().0, path.to_glib_none().0, info.to_glib_none().0, target.as_ref().to_glib_none().0, flags.into_glib(), &mut out_new_label, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_new_label)) } else { Err(from_glib_full(error)) } } } @@ -103,23 +97,17 @@ impl SePolicy { #[doc(alias = "ostree_sepolicy_setfscreatecon")] pub fn setfscreatecon(&self, path: &str, mode: u32) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sepolicy_setfscreatecon(self.to_glib_none().0, path.to_glib_none().0, mode, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } #[doc(alias = "rootfs-dfd")] pub fn rootfs_dfd(&self) -> i32 { - glib::ObjectExt::property(self, "rootfs-dfd") + ObjectExt::property(self, "rootfs-dfd") } } unsafe impl Send for SePolicy {} - -impl fmt::Display for SePolicy { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("SePolicy") - } -} diff --git a/rust-bindings/src/auto/sign.rs b/rust-bindings/src/auto/sign.rs index 90fa1ded5b..42fb16a395 100644 --- a/rust-bindings/src/auto/sign.rs +++ b/rust-bindings/src/auto/sign.rs @@ -2,17 +2,13 @@ // from gir-files // DO NOT EDIT -#[cfg(any(feature = "v2020_2", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] -use crate::Repo; -use glib::object::IsA; -#[cfg(any(feature = "v2020_2", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] -use glib::translate::*; -use std::fmt; -#[cfg(any(feature = "v2020_2", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] -use std::ptr; +#[cfg(feature = "v2020_2")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] +use crate::{Repo}; +use glib::{prelude::*}; +#[cfg(feature = "v2020_2")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] +use glib::{translate::*}; glib::wrapper! { #[doc(alias = "OstreeSign")] @@ -27,8 +23,8 @@ impl Sign { pub const NONE: Option<&'static Sign> = None; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] #[doc(alias = "ostree_sign_get_all")] #[doc(alias = "get_all")] pub fn all() -> Vec { @@ -37,228 +33,175 @@ impl Sign { } } - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] #[doc(alias = "ostree_sign_get_by_name")] #[doc(alias = "get_by_name")] pub fn by_name(name: &str) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_sign_get_by_name(name.to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } } } -pub trait SignExt: 'static { - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] - #[doc(alias = "ostree_sign_add_pk")] - fn add_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error>; - - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] - #[doc(alias = "ostree_sign_clear_keys")] - fn clear_keys(&self) -> Result<(), glib::Error>; - - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] - #[doc(alias = "ostree_sign_commit")] - fn commit(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error>; - - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] - #[doc(alias = "ostree_sign_commit_verify")] - fn commit_verify(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&impl IsA>) -> Result, glib::Error>; - - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] - #[doc(alias = "ostree_sign_data")] - fn data(&self, data: &glib::Bytes, cancellable: Option<&impl IsA>) -> Result; - - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] - #[doc(alias = "ostree_sign_data_verify")] - fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result, glib::Error>; - - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] - #[doc(alias = "ostree_sign_get_name")] - #[doc(alias = "get_name")] - fn name(&self) -> glib::GString; - - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] - #[doc(alias = "ostree_sign_load_pk")] - fn load_pk(&self, options: &glib::Variant) -> Result<(), glib::Error>; - - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] - #[doc(alias = "ostree_sign_metadata_format")] - fn metadata_format(&self) -> glib::GString; - - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] - #[doc(alias = "ostree_sign_metadata_key")] - fn metadata_key(&self) -> glib::GString; - - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] - #[doc(alias = "ostree_sign_set_pk")] - fn set_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error>; - - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] - #[doc(alias = "ostree_sign_set_sk")] - fn set_sk(&self, secret_key: &glib::Variant) -> Result<(), glib::Error>; - - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] - #[doc(alias = "ostree_sign_summary")] - fn summary(&self, repo: &Repo, keys: &glib::Variant, cancellable: Option<&impl IsA>) -> Result<(), glib::Error>; +mod sealed { + pub trait Sealed {} + impl> Sealed for T {} } -impl> SignExt for O { - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] +pub trait SignExt: IsA + sealed::Sealed + 'static { + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] + #[doc(alias = "ostree_sign_add_pk")] fn add_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sign_add_pk(self.as_ref().to_glib_none().0, public_key.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] + #[doc(alias = "ostree_sign_clear_keys")] fn clear_keys(&self) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sign_clear_keys(self.as_ref().to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] + #[doc(alias = "ostree_sign_commit")] fn commit(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sign_commit(self.as_ref().to_glib_none().0, repo.to_glib_none().0, commit_checksum.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] + #[doc(alias = "ostree_sign_commit_verify")] fn commit_verify(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&impl IsA>) -> Result, glib::Error> { unsafe { - let mut out_success_message = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_success_message = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sign_commit_verify(self.as_ref().to_glib_none().0, repo.to_glib_none().0, commit_checksum.to_glib_none().0, &mut out_success_message, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_success_message)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] + #[doc(alias = "ostree_sign_data")] fn data(&self, data: &glib::Bytes, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut signature = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut signature = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sign_data(self.as_ref().to_glib_none().0, data.to_glib_none().0, &mut signature, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(signature)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] + #[doc(alias = "ostree_sign_data_verify")] fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result, glib::Error> { unsafe { - let mut out_success_message = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_success_message = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sign_data_verify(self.as_ref().to_glib_none().0, data.to_glib_none().0, signatures.to_glib_none().0, &mut out_success_message, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_success_message)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] + #[doc(alias = "ostree_sign_get_name")] + #[doc(alias = "get_name")] fn name(&self) -> glib::GString { unsafe { from_glib_none(ffi::ostree_sign_get_name(self.as_ref().to_glib_none().0)) } } - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] + #[doc(alias = "ostree_sign_load_pk")] fn load_pk(&self, options: &glib::Variant) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sign_load_pk(self.as_ref().to_glib_none().0, options.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] + #[doc(alias = "ostree_sign_metadata_format")] fn metadata_format(&self) -> glib::GString { unsafe { from_glib_none(ffi::ostree_sign_metadata_format(self.as_ref().to_glib_none().0)) } } - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] + #[doc(alias = "ostree_sign_metadata_key")] fn metadata_key(&self) -> glib::GString { unsafe { from_glib_none(ffi::ostree_sign_metadata_key(self.as_ref().to_glib_none().0)) } } - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] + #[doc(alias = "ostree_sign_set_pk")] fn set_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sign_set_pk(self.as_ref().to_glib_none().0, public_key.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] + #[doc(alias = "ostree_sign_set_sk")] fn set_sk(&self, secret_key: &glib::Variant) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sign_set_sk(self.as_ref().to_glib_none().0, secret_key.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] + #[doc(alias = "ostree_sign_summary")] fn summary(&self, repo: &Repo, keys: &glib::Variant, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sign_summary(self.as_ref().to_glib_none().0, repo.to_glib_none().0, keys.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } } -impl fmt::Display for Sign { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("Sign") - } -} +impl> SignExt for O {} diff --git a/rust-bindings/src/auto/sysroot.rs b/rust-bindings/src/auto/sysroot.rs index e753f7168e..61f1f9443b 100644 --- a/rust-bindings/src/auto/sysroot.rs +++ b/rust-bindings/src/auto/sysroot.rs @@ -2,39 +2,24 @@ // from gir-files // DO NOT EDIT -use crate::Deployment; -#[cfg(any(feature = "v2016_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] -use crate::DeploymentUnlockedState; -#[cfg(any(feature = "v2017_7", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))] -use crate::Repo; -#[cfg(any(feature = "v2020_7", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] -use crate::SysrootDeployTreeOpts; -use crate::SysrootSimpleWriteDeploymentFlags; -#[cfg(any(feature = "v2017_4", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))] -use crate::SysrootWriteDeploymentsOpts; -use glib::object::IsA; -#[cfg(any(feature = "v2017_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))] -use glib::object::ObjectType as ObjectType_; -#[cfg(any(feature = "v2017_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))] -use glib::signal::connect_raw; -#[cfg(any(feature = "v2017_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))] -use glib::signal::SignalHandlerId; -use glib::translate::*; -use std::boxed::Box as Box_; -use std::fmt; -use std::mem; -#[cfg(any(feature = "v2017_10", feature = "dox"))] -#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))] -use std::mem::transmute; -use std::pin::Pin; -use std::ptr; +use crate::{Deployment,SysrootSimpleWriteDeploymentFlags}; +#[cfg(feature = "v2016_4")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] +use crate::{DeploymentUnlockedState}; +#[cfg(feature = "v2017_4")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_4")))] +use crate::{SysrootWriteDeploymentsOpts}; +#[cfg(feature = "v2017_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))] +use crate::{Repo}; +#[cfg(feature = "v2020_7")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] +use crate::{SysrootDeployTreeOpts}; +use glib::{prelude::*,translate::*}; +#[cfg(feature = "v2017_10")] +#[cfg_attr(docsrs, doc(cfg(feature = "v2017_10")))] +use glib::{signal::{connect_raw, SignalHandlerId}}; +use std::{boxed::Box as Box_,pin::Pin}; glib::wrapper! { #[doc(alias = "OstreeSysroot")] @@ -60,14 +45,14 @@ impl Sysroot { } } - #[cfg(any(feature = "v2023_8", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2023_8")))] + #[cfg(feature = "v2023_8")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2023_8")))] #[doc(alias = "ostree_sysroot_change_finalization")] pub fn change_finalization(&self, deployment: &Deployment) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_change_finalization(self.to_glib_none().0, deployment.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -75,42 +60,42 @@ impl Sysroot { #[doc(alias = "ostree_sysroot_cleanup")] pub fn cleanup(&self, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_cleanup(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - //#[cfg(any(feature = "v2018_6", feature = "dox"))] - //#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + //#[cfg(feature = "v2018_6")] + //#[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] //#[doc(alias = "ostree_sysroot_cleanup_prune_repo")] //pub fn cleanup_prune_repo(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: Option<&impl IsA>) -> Result<(i32, i32, u64), glib::Error> { // unsafe { TODO: call ffi:ostree_sysroot_cleanup_prune_repo() } //} - #[cfg(any(feature = "v2018_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] + #[cfg(feature = "v2018_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))] #[doc(alias = "ostree_sysroot_deploy_tree")] pub fn deploy_tree(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, provided_merge_deployment: Option<&Deployment>, override_kernel_argv: &[&str], cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_new_deployment = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_new_deployment = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_deploy_tree(self.to_glib_none().0, osname.to_glib_none().0, revision.to_glib_none().0, origin.to_glib_none().0, provided_merge_deployment.to_glib_none().0, override_kernel_argv.to_glib_none().0, &mut out_new_deployment, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_new_deployment)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] + #[cfg(feature = "v2020_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] #[doc(alias = "ostree_sysroot_deploy_tree_with_options")] pub fn deploy_tree_with_options(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, provided_merge_deployment: Option<&Deployment>, opts: Option<&SysrootDeployTreeOpts>, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_new_deployment = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_new_deployment = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_deploy_tree_with_options(self.to_glib_none().0, osname.to_glib_none().0, revision.to_glib_none().0, origin.to_glib_none().0, provided_merge_deployment.to_glib_none().0, mut_override(opts.to_glib_none().0), &mut out_new_deployment, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_new_deployment)) } else { Err(from_glib_full(error)) } } } @@ -118,9 +103,9 @@ impl Sysroot { #[doc(alias = "ostree_sysroot_deployment_set_kargs")] pub fn deployment_set_kargs(&self, deployment: &Deployment, new_kargs: &[&str], cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -128,9 +113,9 @@ impl Sysroot { #[doc(alias = "ostree_sysroot_deployment_set_kargs_in_place")] pub fn deployment_set_kargs_in_place(&self, deployment: &Deployment, kargs_str: Option<&str>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_deployment_set_kargs_in_place(self.to_glib_none().0, deployment.to_glib_none().0, kargs_str.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -138,33 +123,33 @@ impl Sysroot { #[doc(alias = "ostree_sysroot_deployment_set_mutable")] pub fn deployment_set_mutable(&self, deployment: &Deployment, is_mutable: bool, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_deployment_set_mutable(self.to_glib_none().0, deployment.to_glib_none().0, is_mutable.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2018_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))] + #[cfg(feature = "v2018_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))] #[doc(alias = "ostree_sysroot_deployment_set_pinned")] pub fn deployment_set_pinned(&self, deployment: &Deployment, is_pinned: bool) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_deployment_set_pinned(self.to_glib_none().0, deployment.to_glib_none().0, is_pinned.into_glib(), &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2016_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] + #[cfg(feature = "v2016_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] #[doc(alias = "ostree_sysroot_deployment_unlock")] pub fn deployment_unlock(&self, deployment: &Deployment, unlocked_state: DeploymentUnlockedState, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_deployment_unlock(self.to_glib_none().0, deployment.to_glib_none().0, unlocked_state.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -172,9 +157,9 @@ impl Sysroot { #[doc(alias = "ostree_sysroot_ensure_initialized")] pub fn ensure_initialized(&self, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_ensure_initialized(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -243,8 +228,8 @@ impl Sysroot { } } - #[cfg(any(feature = "v2018_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] + #[cfg(feature = "v2018_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))] #[doc(alias = "ostree_sysroot_get_staged_deployment")] #[doc(alias = "get_staged_deployment")] pub fn staged_deployment(&self) -> Option { @@ -261,44 +246,44 @@ impl Sysroot { } } - #[cfg(any(feature = "v2016_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] + #[cfg(feature = "v2016_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] #[doc(alias = "ostree_sysroot_init_osname")] pub fn init_osname(&self, osname: &str, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))] + #[cfg(feature = "v2020_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))] #[doc(alias = "ostree_sysroot_initialize")] pub fn initialize(&self) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_initialize(self.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2022_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2022_7")))] + #[cfg(feature = "v2022_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2022_7")))] #[doc(alias = "ostree_sysroot_initialize_with_mount_namespace")] pub fn initialize_with_mount_namespace(&self, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_initialize_with_mount_namespace(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))] + #[cfg(feature = "v2020_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))] #[doc(alias = "ostree_sysroot_is_booted")] pub fn is_booted(&self) -> bool { unsafe { @@ -309,22 +294,22 @@ impl Sysroot { #[doc(alias = "ostree_sysroot_load")] pub fn load(&self, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_load(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2016_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] + #[cfg(feature = "v2016_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] #[doc(alias = "ostree_sysroot_load_if_changed")] pub fn load_if_changed(&self, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_changed = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_changed = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_load_if_changed(self.to_glib_none().0, out_changed.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib(out_changed.assume_init())) } else { Err(from_glib_full(error)) } } } @@ -332,9 +317,9 @@ impl Sysroot { #[doc(alias = "ostree_sysroot_lock")] pub fn lock(&self) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_lock(self.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -354,7 +339,7 @@ impl Sysroot { let user_data: Box_> = Box_::new(glib::thread_guard::ThreadGuard::new(callback)); unsafe extern "C" fn lock_async_trampoline) + 'static>(_source_object: *mut glib::gobject_ffi::GObject, res: *mut gio::ffi::GAsyncResult, user_data: glib::ffi::gpointer) { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let _ = ffi::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_> = Box_::from_raw(user_data as *mut _); @@ -390,27 +375,27 @@ impl Sysroot { #[doc(alias = "ostree_sysroot_prepare_cleanup")] pub fn prepare_cleanup(&self, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_prepare_cleanup(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2017_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))] + #[cfg(feature = "v2017_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))] #[doc(alias = "ostree_sysroot_query_deployments_for")] pub fn query_deployments_for(&self, osname: Option<&str>) -> (Option, Option) { unsafe { - let mut out_pending = ptr::null_mut(); - let mut out_rollback = ptr::null_mut(); + let mut out_pending = std::ptr::null_mut(); + let mut out_rollback = std::ptr::null_mut(); ffi::ostree_sysroot_query_deployments_for(self.to_glib_none().0, osname.to_glib_none().0, &mut out_pending, &mut out_rollback); (from_glib_full(out_pending), from_glib_full(out_rollback)) } } - #[cfg(any(feature = "v2017_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))] + #[cfg(feature = "v2017_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))] #[doc(alias = "ostree_sysroot_repo")] pub fn repo(&self) -> Repo { unsafe { @@ -418,19 +403,19 @@ impl Sysroot { } } - #[cfg(any(feature = "v2021_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))] + #[cfg(feature = "v2021_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))] #[doc(alias = "ostree_sysroot_require_booted_deployment")] pub fn require_booted_deployment(&self) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_sysroot_require_booted_deployment(self.to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_none(ret)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))] + #[cfg(feature = "v2020_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))] #[doc(alias = "ostree_sysroot_set_mount_namespace_in_use")] pub fn set_mount_namespace_in_use(&self) { unsafe { @@ -441,48 +426,48 @@ impl Sysroot { #[doc(alias = "ostree_sysroot_simple_write_deployment")] pub fn simple_write_deployment(&self, osname: Option<&str>, new_deployment: &Deployment, merge_deployment: Option<&Deployment>, flags: SysrootSimpleWriteDeploymentFlags, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] + #[cfg(feature = "v2020_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] #[doc(alias = "ostree_sysroot_stage_overlay_initrd")] pub fn stage_overlay_initrd(&self, fd: i32, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_checksum = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_checksum = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_stage_overlay_initrd(self.to_glib_none().0, fd, &mut out_checksum, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_checksum)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2018_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] + #[cfg(feature = "v2018_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))] #[doc(alias = "ostree_sysroot_stage_tree")] pub fn stage_tree(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, merge_deployment: Option<&Deployment>, override_kernel_argv: &[&str], cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_new_deployment = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_new_deployment = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_stage_tree(self.to_glib_none().0, osname.to_glib_none().0, revision.to_glib_none().0, origin.to_glib_none().0, merge_deployment.to_glib_none().0, override_kernel_argv.to_glib_none().0, &mut out_new_deployment, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_new_deployment)) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2020_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] + #[cfg(feature = "v2020_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] #[doc(alias = "ostree_sysroot_stage_tree_with_options")] pub fn stage_tree_with_options(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, merge_deployment: Option<&Deployment>, opts: &SysrootDeployTreeOpts, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_new_deployment = ptr::null_mut(); - let mut error = ptr::null_mut(); + let mut out_new_deployment = std::ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_stage_tree_with_options(self.to_glib_none().0, osname.to_glib_none().0, revision.to_glib_none().0, origin.to_glib_none().0, merge_deployment.to_glib_none().0, mut_override(opts.to_glib_none().0), &mut out_new_deployment, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib_full(out_new_deployment)) } else { Err(from_glib_full(error)) } } } @@ -490,10 +475,10 @@ impl Sysroot { #[doc(alias = "ostree_sysroot_try_lock")] pub fn try_lock(&self) -> Result { unsafe { - let mut out_acquired = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_acquired = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_try_lock(self.to_glib_none().0, out_acquired.as_mut_ptr(), &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib(out_acquired.assume_init())) } else { Err(from_glib_full(error)) } } } @@ -512,14 +497,14 @@ impl Sysroot { } } - #[cfg(any(feature = "v2023_11", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2023_11")))] + #[cfg(feature = "v2023_11")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2023_11")))] #[doc(alias = "ostree_sysroot_update_post_copy")] pub fn update_post_copy(&self, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_update_post_copy(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -527,21 +512,21 @@ impl Sysroot { #[doc(alias = "ostree_sysroot_write_deployments")] pub fn write_deployments(&self, new_deployments: &[Deployment], cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_write_deployments(self.to_glib_none().0, new_deployments.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } - #[cfg(any(feature = "v2017_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))] + #[cfg(feature = "v2017_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_4")))] #[doc(alias = "ostree_sysroot_write_deployments_with_options")] pub fn write_deployments_with_options(&self, new_deployments: &[Deployment], opts: &SysrootWriteDeploymentsOpts, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_write_deployments_with_options(self.to_glib_none().0, new_deployments.to_glib_none().0, mut_override(opts.to_glib_none().0), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -549,9 +534,9 @@ impl Sysroot { #[doc(alias = "ostree_sysroot_write_origin_file")] pub fn write_origin_file(&self, deployment: &Deployment, new_origin: Option<&glib::KeyFile>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -564,8 +549,8 @@ impl Sysroot { } } - #[cfg(any(feature = "v2017_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))] + #[cfg(feature = "v2017_10")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_10")))] #[doc(alias = "journal-msg")] pub fn connect_journal_msg(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn journal_msg_trampoline(this: *mut ffi::OstreeSysroot, msg: *mut libc::c_char, f: glib::ffi::gpointer) { @@ -575,15 +560,9 @@ impl Sysroot { unsafe { let f: Box_ = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"journal-msg\0".as_ptr() as *const _, - Some(transmute::<_, unsafe extern "C" fn()>(journal_msg_trampoline:: as *const ())), Box_::into_raw(f)) + Some(std::mem::transmute::<_, unsafe extern "C" fn()>(journal_msg_trampoline:: as *const ())), Box_::into_raw(f)) } } } unsafe impl Send for Sysroot {} - -impl fmt::Display for Sysroot { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("Sysroot") - } -} diff --git a/rust-bindings/src/auto/sysroot_upgrader.rs b/rust-bindings/src/auto/sysroot_upgrader.rs index 9e9b9104b0..c535f85b86 100644 --- a/rust-bindings/src/auto/sysroot_upgrader.rs +++ b/rust-bindings/src/auto/sysroot_upgrader.rs @@ -2,19 +2,8 @@ // from gir-files // DO NOT EDIT -use crate::AsyncProgress; -use crate::Repo; -use crate::RepoPullFlags; -use crate::Sysroot; -use crate::SysrootUpgraderFlags; -use crate::SysrootUpgraderPullFlags; -use glib::object::IsA; -use glib::object::ObjectType as ObjectType_; -use glib::translate::*; -use glib::StaticType; -use std::fmt; -use std::mem; -use std::ptr; +use crate::{AsyncProgress,Repo,RepoPullFlags,Sysroot,SysrootUpgraderFlags,SysrootUpgraderPullFlags}; +use glib::{prelude::*,translate::*}; glib::wrapper! { #[doc(alias = "OstreeSysrootUpgrader")] @@ -29,7 +18,7 @@ impl SysrootUpgrader { #[doc(alias = "ostree_sysroot_upgrader_new")] pub fn new(sysroot: &Sysroot, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_sysroot_upgrader_new(sysroot.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } @@ -39,7 +28,7 @@ impl SysrootUpgrader { #[doc(alias = "new_for_os")] pub fn for_os(sysroot: &Sysroot, osname: Option<&str>, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::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); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } @@ -49,7 +38,7 @@ impl SysrootUpgrader { #[doc(alias = "new_for_os_with_flags")] pub fn for_os_with_flags(sysroot: &Sysroot, osname: Option<&str>, flags: SysrootUpgraderFlags, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let ret = ffi::ostree_sysroot_upgrader_new_for_os_with_flags(sysroot.to_glib_none().0, osname.to_glib_none().0, flags.into_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) } } @@ -58,9 +47,9 @@ impl SysrootUpgrader { #[doc(alias = "ostree_sysroot_upgrader_deploy")] pub fn deploy(&self, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_upgrader_deploy(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } @@ -91,10 +80,10 @@ impl SysrootUpgrader { #[doc(alias = "ostree_sysroot_upgrader_pull")] pub fn pull(&self, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: Option<&AsyncProgress>, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_changed = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_changed = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_upgrader_pull(self.to_glib_none().0, flags.into_glib(), upgrader_flags.into_glib(), progress.to_glib_none().0, out_changed.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib(out_changed.assume_init())) } else { Err(from_glib_full(error)) } } } @@ -102,10 +91,10 @@ impl SysrootUpgrader { #[doc(alias = "ostree_sysroot_upgrader_pull_one_dir")] pub fn pull_one_dir(&self, dir_to_pull: &str, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: Option<&AsyncProgress>, cancellable: Option<&impl IsA>) -> Result { unsafe { - let mut out_changed = mem::MaybeUninit::uninit(); - let mut error = ptr::null_mut(); + let mut out_changed = std::mem::MaybeUninit::uninit(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_upgrader_pull_one_dir(self.to_glib_none().0, dir_to_pull.to_glib_none().0, flags.into_glib(), upgrader_flags.into_glib(), progress.to_glib_none().0, out_changed.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(from_glib(out_changed.assume_init())) } else { Err(from_glib_full(error)) } } } @@ -113,38 +102,32 @@ impl SysrootUpgrader { #[doc(alias = "ostree_sysroot_upgrader_set_origin")] pub fn set_origin(&self, origin: Option<&glib::KeyFile>, cancellable: Option<&impl IsA>) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::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); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } pub fn flags(&self) -> SysrootUpgraderFlags { - glib::ObjectExt::property(self, "flags") + ObjectExt::property(self, "flags") } pub fn osname(&self) -> Option { - glib::ObjectExt::property(self, "osname") + ObjectExt::property(self, "osname") } pub fn sysroot(&self) -> Option { - glib::ObjectExt::property(self, "sysroot") + ObjectExt::property(self, "sysroot") } #[doc(alias = "ostree_sysroot_upgrader_check_timestamps")] pub fn check_timestamps(repo: &Repo, from_rev: &str, to_rev: &str) -> Result<(), glib::Error> { unsafe { - let mut error = ptr::null_mut(); + let mut error = std::ptr::null_mut(); let is_ok = ffi::ostree_sysroot_upgrader_check_timestamps(repo.to_glib_none().0, from_rev.to_glib_none().0, to_rev.to_glib_none().0, &mut error); - assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); + debug_assert_eq!(is_ok == glib::ffi::GFALSE, !error.is_null()); if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) } } } } - -impl fmt::Display for SysrootUpgrader { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - f.write_str("SysrootUpgrader") - } -} diff --git a/rust-bindings/src/auto/versions.txt b/rust-bindings/src/auto/versions.txt index 7332d95784..c4bc669821 100644 --- a/rust-bindings/src/auto/versions.txt +++ b/rust-bindings/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d) -from gir-files (@ 8f559e94b775) +Generated by gir (https://github.com/gtk-rs/gir @ 5223ce91b97a) +from gir-files (@ cae315c499c1) diff --git a/rust-bindings/src/repo.rs b/rust-bindings/src/repo.rs index 548cbc8ed9..491a43c348 100644 --- a/rust-bindings/src/repo.rs +++ b/rust-bindings/src/repo.rs @@ -5,7 +5,8 @@ use crate::RepoMode; use crate::{Checksum, ObjectDetails, ObjectName, ObjectType, Repo, RepoTransactionStats}; use ffi::OstreeRepoListObjectsFlags; use glib::ffi as glib_sys; -use glib::{self, translate::*, Error, IsA}; +use glib::object::IsA; +use glib::{self, translate::*, Error}; #[cfg(any(feature = "v2017_10", feature = "dox"))] use std::os::fd::BorrowedFd; use std::{ diff --git a/rust-bindings/src/sysroot.rs b/rust-bindings/src/sysroot.rs index 3d5082b570..80a1842333 100644 --- a/rust-bindings/src/sysroot.rs +++ b/rust-bindings/src/sysroot.rs @@ -74,6 +74,8 @@ impl Sysroot { #[cfg(test)] mod tests { + use gio::prelude::*; + use super::*; #[test] @@ -112,6 +114,9 @@ mod tests { sysroot.path() }; - assert_eq!(path_created.to_string(), path_loaded.to_string()); + assert_eq!( + format!("{:?}", path_created.path()), + format!("{:?}", path_loaded.path()) + ); } } diff --git a/rust-bindings/sys/Cargo.toml b/rust-bindings/sys/Cargo.toml index db5d0b1278..824cb29046 100644 --- a/rust-bindings/sys/Cargo.toml +++ b/rust-bindings/sys/Cargo.toml @@ -4,17 +4,17 @@ system-deps = "6" [dependencies] libc = "0.2" -[dependencies.gio] +[dependencies.gio_sys] package = "gio-sys" -version = "0.18" +version = "0.19" -[dependencies.glib] +[dependencies.glib_sys] package = "glib-sys" -version = "0.18" +version = "0.19" -[dependencies.gobject] +[dependencies.gobject_sys] package = "gobject-sys" -version = "0.18" +version = "0.19" [dev-dependencies] shell-words = "1.0.0" @@ -56,7 +56,7 @@ v2019_6 = ["v2019_4"] v2020_1 = ["v2019_6"] v2020_2 = ["v2020_1"] v2020_4 = ["v2020_2"] -dox = ["glib/dox", "gobject/dox", "gio/dox"] +dox = [] v2020_7 = ["v2020_4"] v2020_8 = ["v2020_7"] v2021_1 = ["v2020_8"] @@ -86,10 +86,14 @@ license = "MIT" links = "ostree-1" name = "ostree-sys" repository = "https://github.com/ostreedev/ostree-rs" -version = "0.14.0" +version = "0.15.0" edition = "2021" + [package.metadata.docs.rs] features = ["dox"] +rustc-args = ["--cfg", "docsrs"] +rustdoc-args = ["--cfg", "docsrs", "--generate-link-to-definition"] + [package.metadata.system-deps.ostree_1] name = "ostree-1" version = "0.0" diff --git a/rust-bindings/sys/build.rs b/rust-bindings/sys/build.rs index e136ab2960..9eac38c61a 100644 --- a/rust-bindings/sys/build.rs +++ b/rust-bindings/sys/build.rs @@ -2,13 +2,13 @@ // from gir-files // DO NOT EDIT -#[cfg(not(feature = "dox"))] +#[cfg(not(docsrs))] use std::process; -#[cfg(feature = "dox")] +#[cfg(docsrs)] fn main() {} // prevent linking libraries to avoid documentation failure -#[cfg(not(feature = "dox"))] +#[cfg(not(docsrs))] fn main() { if let Err(s) = system_deps::Config::new().probe() { println!("cargo:warning={s}"); diff --git a/rust-bindings/sys/src/auto/versions.txt b/rust-bindings/sys/src/auto/versions.txt index 7332d95784..c4bc669821 100644 --- a/rust-bindings/sys/src/auto/versions.txt +++ b/rust-bindings/sys/src/auto/versions.txt @@ -1,2 +1,2 @@ -Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d) -from gir-files (@ 8f559e94b775) +Generated by gir (https://github.com/gtk-rs/gir @ 5223ce91b97a) +from gir-files (@ cae315c499c1) diff --git a/rust-bindings/sys/src/lib.rs b/rust-bindings/sys/src/lib.rs index 9965650411..4ffa8e94a9 100644 --- a/rust-bindings/sys/src/lib.rs +++ b/rust-bindings/sys/src/lib.rs @@ -9,7 +9,11 @@ clippy::unreadable_literal, clippy::upper_case_acronyms )] -#![cfg_attr(feature = "dox", feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_cfg))] + +use gio_sys as gio; +use glib_sys as glib; +use gobject_sys as gobject; mod manual; @@ -18,8 +22,11 @@ pub use manual::*; #[allow(unused_imports)] use libc::{ c_char, c_double, c_float, c_int, c_long, c_short, c_uchar, c_uint, c_ulong, c_ushort, c_void, - intptr_t, size_t, ssize_t, uintptr_t, FILE, + intptr_t, off_t, size_t, ssize_t, time_t, uintptr_t, FILE, }; +#[cfg(unix)] +#[allow(unused_imports)] +use libc::{dev_t, gid_t, pid_t, socklen_t, uid_t}; #[allow(unused_imports)] use glib::{gboolean, gconstpointer, gpointer, GType}; @@ -122,51 +129,32 @@ pub type OstreeStaticDeltaIndexFlags = c_int; pub const OSTREE_STATIC_DELTA_INDEX_FLAGS_NONE: OstreeStaticDeltaIndexFlags = 0; // Constants -pub const OSTREE_COMMIT_GVARIANT_STRING: *const c_char = - b"(a{sv}aya(say)sstayay)\0" as *const u8 as *const c_char; -pub const OSTREE_COMMIT_META_KEY_ARCHITECTURE: *const c_char = - b"ostree.architecture\0" as *const u8 as *const c_char; -pub const OSTREE_COMMIT_META_KEY_COLLECTION_BINDING: *const c_char = - b"ostree.collection-binding\0" as *const u8 as *const c_char; -pub const OSTREE_COMMIT_META_KEY_ENDOFLIFE: *const c_char = - b"ostree.endoflife\0" as *const u8 as *const c_char; -pub const OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE: *const c_char = - b"ostree.endoflife-rebase\0" as *const u8 as *const c_char; -pub const OSTREE_COMMIT_META_KEY_REF_BINDING: *const c_char = - b"ostree.ref-binding\0" as *const u8 as *const c_char; -pub const OSTREE_COMMIT_META_KEY_SOURCE_TITLE: *const c_char = - b"ostree.source-title\0" as *const u8 as *const c_char; -pub const OSTREE_COMMIT_META_KEY_VERSION: *const c_char = - b"version\0" as *const u8 as *const c_char; -pub const OSTREE_DIRMETA_GVARIANT_STRING: *const c_char = - b"(uuua(ayay))\0" as *const u8 as *const c_char; -pub const OSTREE_FILEMETA_GVARIANT_STRING: *const c_char = - b"(uuua(ayay))\0" as *const u8 as *const c_char; -pub const OSTREE_GPG_KEY_GVARIANT_STRING: *const c_char = - b"(aa{sv}aa{sv}a{sv})\0" as *const u8 as *const c_char; +pub const OSTREE_COMMIT_GVARIANT_STRING: &[u8] = b"(a{sv}aya(say)sstayay)\0"; +pub const OSTREE_COMMIT_META_KEY_ARCHITECTURE: &[u8] = b"ostree.architecture\0"; +pub const OSTREE_COMMIT_META_KEY_COLLECTION_BINDING: &[u8] = b"ostree.collection-binding\0"; +pub const OSTREE_COMMIT_META_KEY_ENDOFLIFE: &[u8] = b"ostree.endoflife\0"; +pub const OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE: &[u8] = b"ostree.endoflife-rebase\0"; +pub const OSTREE_COMMIT_META_KEY_REF_BINDING: &[u8] = b"ostree.ref-binding\0"; +pub const OSTREE_COMMIT_META_KEY_SOURCE_TITLE: &[u8] = b"ostree.source-title\0"; +pub const OSTREE_COMMIT_META_KEY_VERSION: &[u8] = b"version\0"; +pub const OSTREE_DIRMETA_GVARIANT_STRING: &[u8] = b"(uuua(ayay))\0"; +pub const OSTREE_FILEMETA_GVARIANT_STRING: &[u8] = b"(uuua(ayay))\0"; +pub const OSTREE_GPG_KEY_GVARIANT_STRING: &[u8] = b"(aa{sv}aa{sv}a{sv})\0"; pub const OSTREE_MAX_METADATA_SIZE: c_int = 134217728; pub const OSTREE_MAX_METADATA_WARN_SIZE: c_int = 7340032; -pub const OSTREE_METADATA_KEY_BOOTABLE: *const c_char = - b"ostree.bootable\0" as *const u8 as *const c_char; -pub const OSTREE_METADATA_KEY_LINUX: *const c_char = - b"ostree.linux\0" as *const u8 as *const c_char; -pub const OSTREE_META_KEY_DEPLOY_COLLECTION_ID: *const c_char = - b"ostree.deploy-collection-id\0" as *const u8 as *const c_char; -pub const OSTREE_ORIGIN_TRANSIENT_GROUP: *const c_char = - b"libostree-transient\0" as *const u8 as *const c_char; -pub const OSTREE_PATH_BOOTED: *const c_char = b"/run/ostree-booted\0" as *const u8 as *const c_char; -pub const OSTREE_REPO_METADATA_REF: *const c_char = - b"ostree-metadata\0" as *const u8 as *const c_char; +pub const OSTREE_METADATA_KEY_BOOTABLE: &[u8] = b"ostree.bootable\0"; +pub const OSTREE_METADATA_KEY_LINUX: &[u8] = b"ostree.linux\0"; +pub const OSTREE_META_KEY_DEPLOY_COLLECTION_ID: &[u8] = b"ostree.deploy-collection-id\0"; +pub const OSTREE_ORIGIN_TRANSIENT_GROUP: &[u8] = b"libostree-transient\0"; +pub const OSTREE_PATH_BOOTED: &[u8] = b"/run/ostree-booted\0"; +pub const OSTREE_REPO_METADATA_REF: &[u8] = b"ostree-metadata\0"; pub const OSTREE_SHA256_DIGEST_LEN: c_int = 32; pub const OSTREE_SHA256_STRING_LEN: c_int = 64; -pub const OSTREE_SIGN_NAME_ED25519: *const c_char = b"ed25519\0" as *const u8 as *const c_char; -pub const OSTREE_SUMMARY_GVARIANT_STRING: *const c_char = - b"(a(s(taya{sv}))a{sv})\0" as *const u8 as *const c_char; -pub const OSTREE_SUMMARY_SIG_GVARIANT_STRING: *const c_char = - b"a{sv}\0" as *const u8 as *const c_char; +pub const OSTREE_SIGN_NAME_ED25519: &[u8] = b"ed25519\0"; +pub const OSTREE_SUMMARY_GVARIANT_STRING: &[u8] = b"(a(s(taya{sv}))a{sv})\0"; +pub const OSTREE_SUMMARY_SIG_GVARIANT_STRING: &[u8] = b"a{sv}\0"; pub const OSTREE_TIMESTAMP: c_int = 0; -pub const OSTREE_TREE_GVARIANT_STRING: *const c_char = - b"(a(say)a(sayay))\0" as *const u8 as *const c_char; +pub const OSTREE_TREE_GVARIANT_STRING: &[u8] = b"(a(say)a(sayay))\0"; // Flags pub type OstreeChecksumFlags = c_uint; @@ -416,7 +404,7 @@ pub struct _OstreeKernelArgs { _marker: core::marker::PhantomData<(*mut u8, core::marker::PhantomPinned)>, } -pub type OstreeKernelArgs = *mut _OstreeKernelArgs; +pub type OstreeKernelArgs = _OstreeKernelArgs; #[derive(Copy, Clone)] #[repr(C)] @@ -1142,57 +1130,57 @@ extern "C" { //========================================================================= // OstreeCollectionRef //========================================================================= - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_collection_ref_get_type() -> GType; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_collection_ref_new( collection_id: *const c_char, ref_name: *const c_char, ) -> *mut OstreeCollectionRef; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_collection_ref_dup(ref_: *const OstreeCollectionRef) -> *mut OstreeCollectionRef; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_collection_ref_equal(ref1: gconstpointer, ref2: gconstpointer) -> gboolean; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_collection_ref_free(ref_: *mut OstreeCollectionRef); - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_collection_ref_hash(ref_: gconstpointer) -> c_uint; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_collection_ref_dupv( refs: *const *const OstreeCollectionRef, ) -> *mut *mut OstreeCollectionRef; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_collection_ref_freev(refs: *mut *mut OstreeCollectionRef); //========================================================================= // OstreeCommitSizesEntry //========================================================================= - #[cfg(any(feature = "v2020_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))] + #[cfg(feature = "v2020_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))] pub fn ostree_commit_sizes_entry_get_type() -> GType; - #[cfg(any(feature = "v2020_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))] + #[cfg(feature = "v2020_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))] pub fn ostree_commit_sizes_entry_new( checksum: *const c_char, objtype: OstreeObjectType, unpacked: u64, archived: u64, ) -> *mut OstreeCommitSizesEntry; - #[cfg(any(feature = "v2020_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))] + #[cfg(feature = "v2020_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))] pub fn ostree_commit_sizes_entry_copy( entry: *const OstreeCommitSizesEntry, ) -> *mut OstreeCommitSizesEntry; - #[cfg(any(feature = "v2020_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))] + #[cfg(feature = "v2020_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))] pub fn ostree_commit_sizes_entry_free(entry: *mut OstreeCommitSizesEntry); //========================================================================= @@ -1205,31 +1193,31 @@ extern "C" { //========================================================================= // OstreeKernelArgs //========================================================================= - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_append(kargs: *mut OstreeKernelArgs, arg: *const c_char); - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_append_argv(kargs: *mut OstreeKernelArgs, argv: *mut *mut c_char); - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_append_argv_filtered( kargs: *mut OstreeKernelArgs, argv: *mut *mut c_char, prefixes: *mut *mut c_char, ); - #[cfg(any(feature = "v2022_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2022_5")))] + #[cfg(feature = "v2022_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2022_5")))] pub fn ostree_kernel_args_append_if_missing(kargs: *mut OstreeKernelArgs, arg: *const c_char); - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_append_proc_cmdline( kargs: *mut OstreeKernelArgs, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2022_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2022_7")))] + #[cfg(feature = "v2022_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2022_7")))] pub fn ostree_kernel_args_contains( kargs: *mut OstreeKernelArgs, arg: *const c_char, @@ -1239,88 +1227,88 @@ extern "C" { arg: *const c_char, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2022_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2022_7")))] + #[cfg(feature = "v2022_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2022_7")))] pub fn ostree_kernel_args_delete_if_present( kargs: *mut OstreeKernelArgs, arg: *const c_char, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_delete_key_entry( kargs: *mut OstreeKernelArgs, key: *const c_char, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_free(kargs: *mut OstreeKernelArgs); - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_get_last_value( kargs: *mut OstreeKernelArgs, key: *const c_char, ) -> *const c_char; - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_new_replace( kargs: *mut OstreeKernelArgs, arg: *const c_char, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_parse_append(kargs: *mut OstreeKernelArgs, options: *const c_char); - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_replace(kargs: *mut OstreeKernelArgs, arg: *const c_char); - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_replace_argv(kargs: *mut OstreeKernelArgs, argv: *mut *mut c_char); - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_replace_take(kargs: *mut OstreeKernelArgs, arg: *mut c_char); - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_to_string(kargs: *mut OstreeKernelArgs) -> *mut c_char; - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_to_strv(kargs: *mut OstreeKernelArgs) -> *mut *mut c_char; - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_cleanup(loc: *mut c_void); - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_from_string(options: *const c_char) -> *mut OstreeKernelArgs; - #[cfg(any(feature = "v2019_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_3")))] + #[cfg(feature = "v2019_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_3")))] pub fn ostree_kernel_args_new() -> *mut OstreeKernelArgs; //========================================================================= // OstreeRemote //========================================================================= - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_remote_get_type() -> GType; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_remote_get_name(remote: *mut OstreeRemote) -> *const c_char; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_remote_get_url(remote: *mut OstreeRemote) -> *mut c_char; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_remote_ref(remote: *mut OstreeRemote) -> *mut OstreeRemote; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_remote_unref(remote: *mut OstreeRemote); //========================================================================= // OstreeRepoCheckoutAtOptions //========================================================================= - #[cfg(any(feature = "v2017_13", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))] + #[cfg(feature = "v2017_13")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))] pub fn ostree_repo_checkout_at_options_set_devino( opts: *mut OstreeRepoCheckoutAtOptions, cache: *mut OstreeRepoDevInoCache, @@ -1339,8 +1327,8 @@ extern "C" { pub fn ostree_repo_commit_modifier_ref( modifier: *mut OstreeRepoCommitModifier, ) -> *mut OstreeRepoCommitModifier; - #[cfg(any(feature = "v2017_13", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))] + #[cfg(feature = "v2017_13")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))] pub fn ostree_repo_commit_modifier_set_devino_cache( modifier: *mut OstreeRepoCommitModifier, cache: *mut OstreeRepoDevInoCache, @@ -1349,8 +1337,8 @@ extern "C" { modifier: *mut OstreeRepoCommitModifier, sepolicy: *mut OstreeSePolicy, ); - #[cfg(any(feature = "v2020_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))] + #[cfg(feature = "v2020_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_4")))] pub fn ostree_repo_commit_modifier_set_sepolicy_from_commit( modifier: *mut OstreeRepoCommitModifier, repo: *mut OstreeRepo, @@ -1415,11 +1403,11 @@ extern "C" { //========================================================================= // OstreeRepoFinderResult //========================================================================= - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_result_get_type() -> GType; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_result_new( remote: *mut OstreeRemote, finder: *mut OstreeRepoFinder, @@ -1428,22 +1416,22 @@ extern "C" { ref_to_timestamp: *mut glib::GHashTable, summary_last_modified: u64, ) -> *mut OstreeRepoFinderResult; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_result_compare( a: *const OstreeRepoFinderResult, b: *const OstreeRepoFinderResult, ) -> c_int; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_result_dup( result: *mut OstreeRepoFinderResult, ) -> *mut OstreeRepoFinderResult; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_result_free(result: *mut OstreeRepoFinderResult); - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_result_freev(results: *mut *mut OstreeRepoFinderResult); //========================================================================= @@ -1460,18 +1448,18 @@ extern "C" { changed: *mut gpointer, user_data: gpointer, ) -> *mut OstreeAsyncProgress; - #[cfg(any(feature = "v2019_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_6")))] + #[cfg(feature = "v2019_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_6")))] pub fn ostree_async_progress_copy_state( self_: *mut OstreeAsyncProgress, dest: *mut OstreeAsyncProgress, ); pub fn ostree_async_progress_finish(self_: *mut OstreeAsyncProgress); - #[cfg(any(feature = "v2017_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))] + #[cfg(feature = "v2017_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))] pub fn ostree_async_progress_get(self_: *mut OstreeAsyncProgress, ...); - #[cfg(any(feature = "v2017_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))] + #[cfg(feature = "v2017_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))] pub fn ostree_async_progress_get_status(self_: *mut OstreeAsyncProgress) -> *mut c_char; pub fn ostree_async_progress_get_uint( self_: *mut OstreeAsyncProgress, @@ -1481,17 +1469,17 @@ extern "C" { self_: *mut OstreeAsyncProgress, key: *const c_char, ) -> u64; - #[cfg(any(feature = "v2017_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))] + #[cfg(feature = "v2017_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))] pub fn ostree_async_progress_get_variant( self_: *mut OstreeAsyncProgress, key: *const c_char, ) -> *mut glib::GVariant; - #[cfg(any(feature = "v2017_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))] + #[cfg(feature = "v2017_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))] pub fn ostree_async_progress_set(self_: *mut OstreeAsyncProgress, ...); - #[cfg(any(feature = "v2017_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))] + #[cfg(feature = "v2017_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))] pub fn ostree_async_progress_set_status(self_: *mut OstreeAsyncProgress, status: *const c_char); pub fn ostree_async_progress_set_uint( self_: *mut OstreeAsyncProgress, @@ -1503,8 +1491,8 @@ extern "C" { key: *const c_char, value: u64, ); - #[cfg(any(feature = "v2017_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))] + #[cfg(feature = "v2017_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_6")))] pub fn ostree_async_progress_set_variant( self_: *mut OstreeAsyncProgress, key: *const c_char, @@ -1523,8 +1511,8 @@ extern "C" { self_: *mut OstreeBootconfigParser, key: *const c_char, ) -> *const c_char; - #[cfg(any(feature = "v2020_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] + #[cfg(feature = "v2020_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] pub fn ostree_bootconfig_parser_get_overlay_initrds( self_: *mut OstreeBootconfigParser, ) -> *mut *mut c_char; @@ -1546,8 +1534,8 @@ extern "C" { key: *const c_char, value: *const c_char, ); - #[cfg(any(feature = "v2020_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] + #[cfg(feature = "v2020_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] pub fn ostree_bootconfig_parser_set_overlay_initrds( self_: *mut OstreeBootconfigParser, initrds: *mut *mut c_char, @@ -1588,11 +1576,11 @@ extern "C" { bootcsum: *const c_char, bootserial: c_int, ) -> *mut OstreeDeployment; - #[cfg(any(feature = "v2018_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))] + #[cfg(feature = "v2018_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))] pub fn ostree_deployment_origin_remove_transient_state(origin: *mut glib::GKeyFile); - #[cfg(any(feature = "v2016_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] + #[cfg(feature = "v2016_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] pub fn ostree_deployment_unlocked_state_to_string( state: OstreeDeploymentUnlockedState, ) -> *const c_char; @@ -1609,20 +1597,20 @@ extern "C" { pub fn ostree_deployment_get_origin(self_: *mut OstreeDeployment) -> *mut glib::GKeyFile; pub fn ostree_deployment_get_origin_relpath(self_: *mut OstreeDeployment) -> *mut c_char; pub fn ostree_deployment_get_osname(self_: *mut OstreeDeployment) -> *const c_char; - #[cfg(any(feature = "v2016_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] + #[cfg(feature = "v2016_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] pub fn ostree_deployment_get_unlocked( self_: *mut OstreeDeployment, ) -> OstreeDeploymentUnlockedState; pub fn ostree_deployment_hash(v: gconstpointer) -> c_uint; - #[cfg(any(feature = "v2023_8", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2023_8")))] + #[cfg(feature = "v2023_8")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2023_8")))] pub fn ostree_deployment_is_finalization_locked(self_: *mut OstreeDeployment) -> gboolean; - #[cfg(any(feature = "v2018_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))] + #[cfg(feature = "v2018_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))] pub fn ostree_deployment_is_pinned(self_: *mut OstreeDeployment) -> gboolean; - #[cfg(any(feature = "v2018_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))] + #[cfg(feature = "v2018_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))] pub fn ostree_deployment_is_staged(self_: *mut OstreeDeployment) -> gboolean; pub fn ostree_deployment_set_bootconfig( self_: *mut OstreeDeployment, @@ -1666,8 +1654,8 @@ extern "C" { key_id: *const c_char, out_signature_index: *mut c_uint, ) -> gboolean; - #[cfg(any(feature = "v2016_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_6")))] + #[cfg(feature = "v2016_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_6")))] pub fn ostree_gpg_verify_result_require_valid_signature( result: *mut OstreeGpgVerifyResult, error: *mut *mut glib::GError, @@ -1678,22 +1666,22 @@ extern "C" { //========================================================================= pub fn ostree_mutable_tree_get_type() -> GType; pub fn ostree_mutable_tree_new() -> *mut OstreeMutableTree; - #[cfg(any(feature = "v2018_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_7")))] + #[cfg(feature = "v2018_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_7")))] pub fn ostree_mutable_tree_new_from_checksum( repo: *mut OstreeRepo, contents_checksum: *const c_char, metadata_checksum: *const c_char, ) -> *mut OstreeMutableTree; - #[cfg(any(feature = "v2021_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_5")))] + #[cfg(feature = "v2021_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_5")))] pub fn ostree_mutable_tree_new_from_commit( repo: *mut OstreeRepo, rev: *const c_char, error: *mut *mut glib::GError, ) -> *mut OstreeMutableTree; - #[cfg(any(feature = "v2018_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_7")))] + #[cfg(feature = "v2018_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_7")))] pub fn ostree_mutable_tree_check_error( self_: *mut OstreeMutableTree, error: *mut *mut glib::GError, @@ -1711,8 +1699,8 @@ extern "C" { out_parent: *mut *mut OstreeMutableTree, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_7")))] + #[cfg(feature = "v2018_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_7")))] pub fn ostree_mutable_tree_fill_empty_from_dirtree( self_: *mut OstreeMutableTree, repo: *mut OstreeRepo, @@ -1734,8 +1722,8 @@ extern "C" { out_subdir: *mut *mut OstreeMutableTree, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_9", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_9")))] + #[cfg(feature = "v2018_9")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_9")))] pub fn ostree_mutable_tree_remove( self_: *mut OstreeMutableTree, name: *const c_char, @@ -1774,8 +1762,8 @@ extern "C" { repo_path: *mut gio::GFile, sysroot_path: *mut gio::GFile, ) -> *mut OstreeRepo; - #[cfg(any(feature = "v2017_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))] + #[cfg(feature = "v2017_10")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_10")))] pub fn ostree_repo_create_at( dfd: c_int, path: *const c_char, @@ -1789,8 +1777,8 @@ extern "C" { out_mode: *mut OstreeRepoMode, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2017_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))] + #[cfg(feature = "v2017_10")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_10")))] pub fn ostree_repo_open_at( dfd: c_int, path: *const c_char, @@ -1801,12 +1789,12 @@ extern "C" { progress: *mut OstreeAsyncProgress, user_data: gpointer, ); - #[cfg(any(feature = "v2018_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] + #[cfg(feature = "v2018_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))] pub fn ostree_repo_traverse_new_parents() -> *mut glib::GHashTable; pub fn ostree_repo_traverse_new_reachable() -> *mut glib::GHashTable; - #[cfg(any(feature = "v2018_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] + #[cfg(feature = "v2018_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))] pub fn ostree_repo_traverse_parents_get_commits( parents: *mut glib::GHashTable, object: *mut glib::GVariant, @@ -1830,8 +1818,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2016_8", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_8")))] + #[cfg(feature = "v2016_8")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_8")))] pub fn ostree_repo_checkout_at( self_: *mut OstreeRepo, options: *mut OstreeRepoCheckoutAtOptions, @@ -1902,8 +1890,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2017_12", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_12")))] + #[cfg(feature = "v2017_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_12")))] pub fn ostree_repo_equal(a: *mut OstreeRepo, b: *mut OstreeRepo) -> gboolean; pub fn ostree_repo_export_tree_to_archive( self_: *mut OstreeRepo, @@ -1913,8 +1901,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_find_remotes_async( self_: *mut OstreeRepo, refs: *const *const OstreeCollectionRef, @@ -1925,15 +1913,15 @@ extern "C" { callback: gio::GAsyncReadyCallback, user_data: gpointer, ); - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_find_remotes_finish( self_: *mut OstreeRepo, result: *mut gio::GAsyncResult, error: *mut *mut glib::GError, ) -> *mut *mut OstreeRepoFinderResult; - #[cfg(any(feature = "v2017_15", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_15")))] + #[cfg(feature = "v2017_15")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_15")))] pub fn ostree_repo_fsck_object( self_: *mut OstreeRepo, objtype: OstreeObjectType, @@ -1941,22 +1929,22 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2019_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_2")))] + #[cfg(feature = "v2019_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_2")))] pub fn ostree_repo_get_bootloader(self_: *mut OstreeRepo) -> *const c_char; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_get_collection_id(self_: *mut OstreeRepo) -> *const c_char; pub fn ostree_repo_get_config(self_: *mut OstreeRepo) -> *mut glib::GKeyFile; - #[cfg(any(feature = "v2018_9", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_9")))] + #[cfg(feature = "v2018_9")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_9")))] pub fn ostree_repo_get_default_repo_finders(self_: *mut OstreeRepo) -> *const *const c_char; - #[cfg(any(feature = "v2016_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] + #[cfg(feature = "v2016_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] pub fn ostree_repo_get_dfd(self_: *mut OstreeRepo) -> c_int; pub fn ostree_repo_get_disable_fsync(self_: *mut OstreeRepo) -> gboolean; - #[cfg(any(feature = "v2018_9", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_9")))] + #[cfg(feature = "v2018_9")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_9")))] pub fn ostree_repo_get_min_free_space_bytes( self_: *mut OstreeRepo, out_reserved_bytes: *mut u64, @@ -1965,8 +1953,8 @@ extern "C" { pub fn ostree_repo_get_mode(self_: *mut OstreeRepo) -> OstreeRepoMode; pub fn ostree_repo_get_parent(self_: *mut OstreeRepo) -> *mut OstreeRepo; pub fn ostree_repo_get_path(self_: *mut OstreeRepo) -> *mut gio::GFile; - #[cfg(any(feature = "v2016_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))] + #[cfg(feature = "v2016_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] pub fn ostree_repo_get_remote_boolean_option( self_: *mut OstreeRepo, remote_name: *const c_char, @@ -1975,8 +1963,8 @@ extern "C" { out_value: *mut gboolean, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2016_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))] + #[cfg(feature = "v2016_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] pub fn ostree_repo_get_remote_list_option( self_: *mut OstreeRepo, remote_name: *const c_char, @@ -1984,8 +1972,8 @@ extern "C" { out_value: *mut *mut *mut c_char, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2016_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))] + #[cfg(feature = "v2016_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] pub fn ostree_repo_get_remote_option( self_: *mut OstreeRepo, remote_name: *const c_char, @@ -1994,8 +1982,8 @@ extern "C" { out_value: *mut *mut c_char, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_8", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_8")))] + #[cfg(feature = "v2020_8")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_8")))] pub fn ostree_repo_gpg_sign_data( self_: *mut OstreeRepo, data: *mut glib::GBytes, @@ -2006,8 +1994,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2016_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_6")))] + #[cfg(feature = "v2016_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_6")))] pub fn ostree_repo_gpg_verify_data( self_: *mut OstreeRepo, remote_name: *const c_char, @@ -2026,8 +2014,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2017_12", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_12")))] + #[cfg(feature = "v2017_12")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_12")))] pub fn ostree_repo_hash(self_: *mut OstreeRepo) -> c_uint; pub fn ostree_repo_import_archive_to_mtree( self_: *mut OstreeRepo, @@ -2046,8 +2034,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2016_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))] + #[cfg(feature = "v2016_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] pub fn ostree_repo_import_object_from_with_trust( self_: *mut OstreeRepo, source: *mut OstreeRepo, @@ -2062,8 +2050,8 @@ extern "C" { self_: *mut OstreeRepo, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_list_collection_refs( self_: *mut OstreeRepo, match_collection_id: *const c_char, @@ -2093,8 +2081,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2016_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] + #[cfg(feature = "v2016_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] pub fn ostree_repo_list_refs_ext( self_: *mut OstreeRepo, refspec_prefix: *const c_char, @@ -2103,8 +2091,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_8", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_8")))] + #[cfg(feature = "v2020_8")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_8")))] pub fn ostree_repo_list_static_delta_indexes( self_: *mut OstreeRepo, out_indexes: *mut *mut glib::GPtrArray, @@ -2117,8 +2105,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2015_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))] + #[cfg(feature = "v2015_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2015_7")))] pub fn ostree_repo_load_commit( self_: *mut OstreeRepo, checksum: *const c_char, @@ -2158,32 +2146,32 @@ extern "C" { out_variant: *mut *mut glib::GVariant, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2021_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_3")))] + #[cfg(feature = "v2021_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_3")))] pub fn ostree_repo_lock_pop( self_: *mut OstreeRepo, lock_type: OstreeRepoLockType, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2021_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_3")))] + #[cfg(feature = "v2021_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_3")))] pub fn ostree_repo_lock_push( self_: *mut OstreeRepo, lock_type: OstreeRepoLockType, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2017_15", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_15")))] + #[cfg(feature = "v2017_15")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_15")))] pub fn ostree_repo_mark_commit_partial( self_: *mut OstreeRepo, checksum: *const c_char, is_partial: gboolean, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2019_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_4")))] + #[cfg(feature = "v2019_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2019_4")))] pub fn ostree_repo_mark_commit_partial_reason( self_: *mut OstreeRepo, checksum: *const c_char, @@ -2212,8 +2200,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2017_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_1")))] + #[cfg(feature = "v2017_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_1")))] pub fn ostree_repo_prune_from_reachable( self_: *mut OstreeRepo, options: *mut OstreeRepoPruneOptions, @@ -2238,8 +2226,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_pull_from_remotes_async( self_: *mut OstreeRepo, results: *const *const OstreeRepoFinderResult, @@ -2249,8 +2237,8 @@ extern "C" { callback: gio::GAsyncReadyCallback, user_data: gpointer, ); - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_pull_from_remotes_finish( self_: *mut OstreeRepo, result: *mut gio::GAsyncResult, @@ -2297,8 +2285,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2023_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2023_1")))] + #[cfg(feature = "v2023_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2023_1")))] pub fn ostree_repo_regenerate_metadata( self_: *mut OstreeRepo, additional_metadata: *mut glib::GVariant, @@ -2312,8 +2300,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2017_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_2")))] + #[cfg(feature = "v2017_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_2")))] pub fn ostree_repo_reload_config( self_: *mut OstreeRepo, cancellable: *mut gio::GCancellable, @@ -2351,8 +2339,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2016_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_6")))] + #[cfg(feature = "v2016_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_6")))] pub fn ostree_repo_remote_fetch_summary_with_options( self_: *mut OstreeRepo, name: *const c_char, @@ -2362,8 +2350,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2021_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))] + #[cfg(feature = "v2021_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_4")))] pub fn ostree_repo_remote_get_gpg_keys( self_: *mut OstreeRepo, name: *const c_char, @@ -2403,8 +2391,8 @@ extern "C" { self_: *mut OstreeRepo, out_n_remotes: *mut c_uint, ) -> *mut *mut c_char; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_remote_list_collection_refs( self_: *mut OstreeRepo, remote_name: *const c_char, @@ -2419,8 +2407,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_resolve_collection_ref( self_: *mut OstreeRepo, ref_: *const OstreeCollectionRef, @@ -2430,8 +2418,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_resolve_keyring_for_collection( self_: *mut OstreeRepo, collection_id: *const c_char, @@ -2445,8 +2433,8 @@ extern "C" { out_rev: *mut *mut c_char, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2016_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_7")))] + #[cfg(feature = "v2016_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_7")))] pub fn ostree_repo_resolve_rev_ext( self_: *mut OstreeRepo, refspec: *const c_char, @@ -2460,8 +2448,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2017_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))] + #[cfg(feature = "v2017_10")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_10")))] pub fn ostree_repo_set_alias_ref_immediate( self_: *mut OstreeRepo, remote: *const c_char, @@ -2470,8 +2458,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2016_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))] + #[cfg(feature = "v2016_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] pub fn ostree_repo_set_cache_dir( self_: *mut OstreeRepo, dfd: c_int, @@ -2479,15 +2467,15 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_set_collection_id( self_: *mut OstreeRepo, collection_id: *const c_char, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_set_collection_ref_immediate( self_: *mut OstreeRepo, ref_: *const OstreeCollectionRef, @@ -2521,8 +2509,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2021_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))] + #[cfg(feature = "v2021_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_4")))] pub fn ostree_repo_signature_verify_commit_data( self_: *mut OstreeRepo, remote_name: *const c_char, @@ -2539,8 +2527,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] + #[cfg(feature = "v2020_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] pub fn ostree_repo_static_delta_execute_offline_with_signature( self_: *mut OstreeRepo, dir_or_file: *mut gio::GFile, @@ -2559,8 +2547,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_8", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_8")))] + #[cfg(feature = "v2020_8")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_8")))] pub fn ostree_repo_static_delta_reindex( repo: *mut OstreeRepo, flags: OstreeStaticDeltaIndexFlags, @@ -2568,8 +2556,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] + #[cfg(feature = "v2020_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] pub fn ostree_repo_static_delta_verify_signature( self_: *mut OstreeRepo, delta_id: *const c_char, @@ -2577,8 +2565,8 @@ extern "C" { out_success_message: *mut *mut c_char, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_transaction_set_collection_ref( self_: *mut OstreeRepo, ref_: *const OstreeCollectionRef, @@ -2611,8 +2599,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] + #[cfg(feature = "v2018_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))] pub fn ostree_repo_traverse_commit_union_with_parents( repo: *mut OstreeRepo, commit_checksum: *const c_char, @@ -2622,8 +2610,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] + #[cfg(feature = "v2018_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))] pub fn ostree_repo_traverse_commit_with_flags( repo: *mut OstreeRepo, flags: OstreeRepoCommitTraverseFlags, @@ -2634,8 +2622,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_traverse_reachable_refs( self_: *mut OstreeRepo, depth: c_uint, @@ -2659,8 +2647,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> *mut OstreeGpgVerifyResult; - #[cfg(any(feature = "v2016_14", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_14")))] + #[cfg(feature = "v2016_14")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_14")))] pub fn ostree_repo_verify_commit_for_remote( self_: *mut OstreeRepo, commit_checksum: *const c_char, @@ -2826,8 +2814,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2021_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_2")))] + #[cfg(feature = "v2021_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_2")))] pub fn ostree_repo_write_regfile( self_: *mut OstreeRepo, expected_checksum: *const c_char, @@ -2838,8 +2826,8 @@ extern "C" { xattrs: *mut glib::GVariant, error: *mut *mut glib::GError, ) -> *mut OstreeContentWriter; - #[cfg(any(feature = "v2021_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_2")))] + #[cfg(feature = "v2021_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_2")))] pub fn ostree_repo_write_regfile_inline( self_: *mut OstreeRepo, expected_checksum: *const c_char, @@ -2852,8 +2840,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> *mut c_char; - #[cfg(any(feature = "v2021_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_2")))] + #[cfg(feature = "v2021_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_2")))] pub fn ostree_repo_write_symlink( self_: *mut OstreeRepo, expected_checksum: *const c_char, @@ -2913,35 +2901,35 @@ extern "C" { // OstreeRepoFinderAvahi //========================================================================= pub fn ostree_repo_finder_avahi_get_type() -> GType; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_avahi_new( context: *mut glib::GMainContext, ) -> *mut OstreeRepoFinderAvahi; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_avahi_start( self_: *mut OstreeRepoFinderAvahi, error: *mut *mut glib::GError, ); - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_avahi_stop(self_: *mut OstreeRepoFinderAvahi); //========================================================================= // OstreeRepoFinderConfig //========================================================================= pub fn ostree_repo_finder_config_get_type() -> GType; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_config_new() -> *mut OstreeRepoFinderConfig; //========================================================================= // OstreeRepoFinderMount //========================================================================= pub fn ostree_repo_finder_mount_get_type() -> GType; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_mount_new( monitor: *mut gio::GVolumeMonitor, ) -> *mut OstreeRepoFinderMount; @@ -2950,11 +2938,11 @@ extern "C" { // OstreeRepoFinderOverride //========================================================================= pub fn ostree_repo_finder_override_get_type() -> GType; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_override_new() -> *mut OstreeRepoFinderOverride; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_override_add_uri( self_: *mut OstreeRepoFinderOverride, uri: *const c_char, @@ -2969,8 +2957,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> *mut OstreeSePolicy; - #[cfg(any(feature = "v2017_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))] + #[cfg(feature = "v2017_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_4")))] pub fn ostree_sepolicy_new_at( rootfs_dfd: c_int, cancellable: *mut gio::GCancellable, @@ -2983,8 +2971,8 @@ extern "C" { error: *mut *mut glib::GError, ) -> *mut OstreeSePolicy; pub fn ostree_sepolicy_fscreatecon_cleanup(unused: *mut *mut c_void); - #[cfg(any(feature = "v2016_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))] + #[cfg(feature = "v2016_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_5")))] pub fn ostree_sepolicy_get_csum(self_: *mut OstreeSePolicy) -> *const c_char; pub fn ostree_sepolicy_get_label( self_: *mut OstreeSePolicy, @@ -3022,8 +3010,8 @@ extern "C" { pub fn ostree_sysroot_get_deployment_origin_path( deployment_path: *mut gio::GFile, ) -> *mut gio::GFile; - #[cfg(any(feature = "v2023_8", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2023_8")))] + #[cfg(feature = "v2023_8")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2023_8")))] pub fn ostree_sysroot_change_finalization( self_: *mut OstreeSysroot, deployment: *mut OstreeDeployment, @@ -3034,8 +3022,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_sysroot_cleanup_prune_repo( sysroot: *mut OstreeSysroot, options: *mut OstreeRepoPruneOptions, @@ -3045,8 +3033,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] + #[cfg(feature = "v2018_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))] pub fn ostree_sysroot_deploy_tree( self_: *mut OstreeSysroot, osname: *const c_char, @@ -3058,8 +3046,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] + #[cfg(feature = "v2020_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] pub fn ostree_sysroot_deploy_tree_with_options( self_: *mut OstreeSysroot, osname: *const c_char, @@ -3092,16 +3080,16 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))] + #[cfg(feature = "v2018_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_3")))] pub fn ostree_sysroot_deployment_set_pinned( self_: *mut OstreeSysroot, deployment: *mut OstreeDeployment, is_pinned: gboolean, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2016_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] + #[cfg(feature = "v2016_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] pub fn ostree_sysroot_deployment_unlock( self_: *mut OstreeSysroot, deployment: *mut OstreeDeployment, @@ -3138,42 +3126,42 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] + #[cfg(feature = "v2018_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))] pub fn ostree_sysroot_get_staged_deployment(self_: *mut OstreeSysroot) -> *mut OstreeDeployment; pub fn ostree_sysroot_get_subbootversion(self_: *mut OstreeSysroot) -> c_int; - #[cfg(any(feature = "v2016_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] + #[cfg(feature = "v2016_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] pub fn ostree_sysroot_init_osname( self_: *mut OstreeSysroot, osname: *const c_char, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))] + #[cfg(feature = "v2020_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))] pub fn ostree_sysroot_initialize( self_: *mut OstreeSysroot, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2022_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2022_7")))] + #[cfg(feature = "v2022_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2022_7")))] pub fn ostree_sysroot_initialize_with_mount_namespace( self_: *mut OstreeSysroot, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))] + #[cfg(feature = "v2020_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))] pub fn ostree_sysroot_is_booted(self_: *mut OstreeSysroot) -> gboolean; pub fn ostree_sysroot_load( self_: *mut OstreeSysroot, cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2016_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))] + #[cfg(feature = "v2016_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_4")))] pub fn ostree_sysroot_load_if_changed( self_: *mut OstreeSysroot, out_changed: *mut gboolean, @@ -3204,25 +3192,25 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2017_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))] + #[cfg(feature = "v2017_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))] pub fn ostree_sysroot_query_deployments_for( self_: *mut OstreeSysroot, osname: *const c_char, out_pending: *mut *mut OstreeDeployment, out_rollback: *mut *mut OstreeDeployment, ); - #[cfg(any(feature = "v2017_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))] + #[cfg(feature = "v2017_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_7")))] pub fn ostree_sysroot_repo(self_: *mut OstreeSysroot) -> *mut OstreeRepo; - #[cfg(any(feature = "v2021_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))] + #[cfg(feature = "v2021_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))] pub fn ostree_sysroot_require_booted_deployment( self_: *mut OstreeSysroot, error: *mut *mut glib::GError, ) -> *mut OstreeDeployment; - #[cfg(any(feature = "v2020_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))] + #[cfg(feature = "v2020_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))] pub fn ostree_sysroot_set_mount_namespace_in_use(self_: *mut OstreeSysroot); pub fn ostree_sysroot_simple_write_deployment( sysroot: *mut OstreeSysroot, @@ -3233,8 +3221,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] + #[cfg(feature = "v2020_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] pub fn ostree_sysroot_stage_overlay_initrd( self_: *mut OstreeSysroot, fd: c_int, @@ -3242,8 +3230,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_5", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))] + #[cfg(feature = "v2018_5")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_5")))] pub fn ostree_sysroot_stage_tree( self_: *mut OstreeSysroot, osname: *const c_char, @@ -3255,8 +3243,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_7", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))] + #[cfg(feature = "v2020_7")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_7")))] pub fn ostree_sysroot_stage_tree_with_options( self_: *mut OstreeSysroot, osname: *const c_char, @@ -3275,8 +3263,8 @@ extern "C" { ) -> gboolean; pub fn ostree_sysroot_unload(self_: *mut OstreeSysroot); pub fn ostree_sysroot_unlock(self_: *mut OstreeSysroot); - #[cfg(any(feature = "v2023_11", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2023_11")))] + #[cfg(feature = "v2023_11")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2023_11")))] pub fn ostree_sysroot_update_post_copy( self_: *mut OstreeSysroot, cancellable: *mut gio::GCancellable, @@ -3288,8 +3276,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2017_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))] + #[cfg(feature = "v2017_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_4")))] pub fn ostree_sysroot_write_deployments_with_options( self_: *mut OstreeSysroot, new_deployments: *mut glib::GPtrArray, @@ -3377,8 +3365,8 @@ extern "C" { // OstreeRepoFinder //========================================================================= pub fn ostree_repo_finder_get_type() -> GType; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_resolve_all_async( finders: *const *mut OstreeRepoFinder, refs: *const *const OstreeCollectionRef, @@ -3387,14 +3375,14 @@ extern "C" { callback: gio::GAsyncReadyCallback, user_data: gpointer, ); - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_resolve_all_finish( result: *mut gio::GAsyncResult, error: *mut *mut glib::GError, ) -> *mut glib::GPtrArray; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_resolve_async( self_: *mut OstreeRepoFinder, refs: *const *const OstreeCollectionRef, @@ -3403,8 +3391,8 @@ extern "C" { callback: gio::GAsyncReadyCallback, user_data: gpointer, ); - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_repo_finder_resolve_finish( self_: *mut OstreeRepoFinder, result: *mut gio::GAsyncResult, @@ -3415,30 +3403,30 @@ extern "C" { // OstreeSign //========================================================================= pub fn ostree_sign_get_type() -> GType; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_get_all() -> *mut glib::GPtrArray; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_get_by_name( name: *const c_char, error: *mut *mut glib::GError, ) -> *mut OstreeSign; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_add_pk( self_: *mut OstreeSign, public_key: *mut glib::GVariant, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_clear_keys( self_: *mut OstreeSign, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_commit( self_: *mut OstreeSign, repo: *mut OstreeRepo, @@ -3446,8 +3434,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_commit_verify( self_: *mut OstreeSign, repo: *mut OstreeRepo, @@ -3456,8 +3444,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_data( self_: *mut OstreeSign, data: *mut glib::GBytes, @@ -3465,8 +3453,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_data_verify( self_: *mut OstreeSign, data: *mut glib::GBytes, @@ -3515,38 +3503,38 @@ extern "C" { secret_key: *mut glib::GVariant, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_get_name(self_: *mut OstreeSign) -> *const c_char; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_load_pk( self_: *mut OstreeSign, options: *mut glib::GVariant, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_metadata_format(self_: *mut OstreeSign) -> *const c_char; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_metadata_key(self_: *mut OstreeSign) -> *const c_char; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_set_pk( self_: *mut OstreeSign, public_key: *mut glib::GVariant, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_set_sk( self_: *mut OstreeSign, secret_key: *mut glib::GVariant, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2020_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))] + #[cfg(feature = "v2020_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_2")))] pub fn ostree_sign_summary( self_: *mut OstreeSign, repo: *mut OstreeRepo, @@ -3558,8 +3546,8 @@ extern "C" { //========================================================================= // Other functions //========================================================================= - #[cfg(any(feature = "v2017_15", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_15")))] + #[cfg(feature = "v2017_15")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_15")))] pub fn ostree_break_hardlink( dfd: c_int, path: *const c_char, @@ -3567,16 +3555,16 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2017_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))] + #[cfg(feature = "v2017_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_4")))] pub fn ostree_check_version(required_year: c_uint, required_release: c_uint) -> gboolean; - #[cfg(any(feature = "v2016_8", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_8")))] + #[cfg(feature = "v2016_8")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_8")))] pub fn ostree_checksum_b64_from_bytes(csum: *const [c_uchar; 32]) -> *mut c_char; pub fn ostree_checksum_b64_inplace_from_bytes(csum: *const [c_uchar; 32], buf: *mut c_char); pub fn ostree_checksum_b64_inplace_to_bytes(checksum: *const [c_char; 32], buf: *mut u8); - #[cfg(any(feature = "v2016_8", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_8")))] + #[cfg(feature = "v2016_8")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_8")))] pub fn ostree_checksum_b64_to_bytes(checksum: *const c_char) -> *mut [c_uchar; 32]; pub fn ostree_checksum_bytes_peek(bytes: *mut glib::GVariant) -> *const [c_uchar; 32]; pub fn ostree_checksum_bytes_peek_validate( @@ -3604,8 +3592,8 @@ extern "C" { out_csum: *mut *mut [*mut u8; 32], error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2017_13", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))] + #[cfg(feature = "v2017_13")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_13")))] pub fn ostree_checksum_file_at( dfd: c_int, path: *const c_char, @@ -3632,22 +3620,22 @@ extern "C" { pub fn ostree_checksum_to_bytes(checksum: *const c_char) -> *mut [c_uchar; 32]; pub fn ostree_checksum_to_bytes_v(checksum: *const c_char) -> *mut glib::GVariant; pub fn ostree_cmp_checksum_bytes(a: *const u8, b: *const u8) -> c_int; - #[cfg(any(feature = "v2018_2", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))] + #[cfg(feature = "v2018_2")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_2")))] pub fn ostree_commit_get_content_checksum(commit_variant: *mut glib::GVariant) -> *mut c_char; - #[cfg(any(feature = "v2020_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))] + #[cfg(feature = "v2020_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2020_1")))] pub fn ostree_commit_get_object_sizes( commit_variant: *mut glib::GVariant, out_sizes_entries: *mut *mut glib::GPtrArray, error: *mut *mut glib::GError, ) -> gboolean; pub fn ostree_commit_get_parent(commit_variant: *mut glib::GVariant) -> *mut c_char; - #[cfg(any(feature = "v2016_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_3")))] + #[cfg(feature = "v2016_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_3")))] pub fn ostree_commit_get_timestamp(commit_variant: *mut glib::GVariant) -> u64; - #[cfg(any(feature = "v2021_1", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))] + #[cfg(feature = "v2021_1")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2021_1")))] pub fn ostree_commit_metadata_for_bootable( root: *mut gio::GFile, dict: *mut glib::GVariantDict, @@ -3700,8 +3688,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2017_4", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))] + #[cfg(feature = "v2017_4")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_4")))] pub fn ostree_diff_dirs_with_options( flags: OstreeDiffFlags, a: *mut gio::GFile, @@ -3731,8 +3719,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> *mut glib::GVariant; - #[cfg(any(feature = "v2017_10", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))] + #[cfg(feature = "v2017_10")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_10")))] pub fn ostree_gpg_error_quark() -> glib::GQuark; pub fn ostree_hash_object_name(a: gconstpointer) -> c_uint; pub fn ostree_metadata_variant_type(objtype: OstreeObjectType) -> *const glib::GVariantType; @@ -3762,8 +3750,8 @@ extern "C" { out_ref: *mut *mut c_char, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2016_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_6")))] + #[cfg(feature = "v2016_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2016_6")))] pub fn ostree_raw_file_to_archive_z2_stream( input: *mut gio::GInputStream, file_info: *mut gio::GFileInfo, @@ -3772,8 +3760,8 @@ extern "C" { cancellable: *mut gio::GCancellable, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2017_3", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_3")))] + #[cfg(feature = "v2017_3")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_3")))] pub fn ostree_raw_file_to_archive_z2_stream_with_options( input: *mut gio::GInputStream, file_info: *mut gio::GFileInfo, @@ -3796,14 +3784,14 @@ extern "C" { sha256: *const c_char, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2018_6", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))] + #[cfg(feature = "v2018_6")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2018_6")))] pub fn ostree_validate_collection_id( collection_id: *const c_char, error: *mut *mut glib::GError, ) -> gboolean; - #[cfg(any(feature = "v2017_8", feature = "dox"))] - #[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_8")))] + #[cfg(feature = "v2017_8")] + #[cfg_attr(docsrs, doc(cfg(feature = "v2017_8")))] pub fn ostree_validate_remote_name( remote_name: *const c_char, error: *mut *mut glib::GError, diff --git a/rust-bindings/sys/tests/abi.rs b/rust-bindings/sys/tests/abi.rs index a05235af10..e4c4b6cc17 100644 --- a/rust-bindings/sys/tests/abi.rs +++ b/rust-bindings/sys/tests/abi.rs @@ -2,13 +2,15 @@ // from gir-files // DO NOT EDIT +#![cfg(unix)] + use ostree_sys::*; use std::env; use std::error::Error; use std::ffi::OsString; use std::mem::{align_of, size_of}; use std::path::Path; -use std::process::Command; +use std::process::{Command, Stdio}; use std::str; use tempfile::Builder; @@ -68,9 +70,11 @@ fn pkg_config_cflags(packages: &[&str]) -> Result, Box> { let mut cmd = Command::new(pkg_config); cmd.arg("--cflags"); cmd.args(packages); + cmd.stderr(Stdio::inherit()); let out = cmd.output()?; if !out.status.success() { - return Err(format!("command {cmd:?} returned {}", out.status).into()); + let (status, stdout) = (out.status, String::from_utf8_lossy(&out.stdout)); + return Err(format!("command {cmd:?} failed, {status:?}\nstdout: {stdout}").into()); } let stdout = str::from_utf8(&out.stdout)?; Ok(shell_words::split(stdout.trim())?) @@ -110,7 +114,6 @@ impl Results { } #[test] -#[cfg(target_os = "linux")] fn cross_validate_constants_with_c() { let mut c_constants: Vec<(String, String)> = Vec::new(); @@ -145,7 +148,6 @@ fn cross_validate_constants_with_c() { } #[test] -#[cfg(target_os = "linux")] fn cross_validate_layout_with_c() { let mut c_layouts = Vec::new(); @@ -187,13 +189,15 @@ fn get_c_output(name: &str) -> Result> { let cc = Compiler::new().expect("configured compiler"); cc.compile(&c_file, &exe)?; - let mut abi_cmd = Command::new(exe); - let output = abi_cmd.output()?; - if !output.status.success() { - return Err(format!("command {abi_cmd:?} failed, {output:?}").into()); + let mut cmd = Command::new(exe); + cmd.stderr(Stdio::inherit()); + let out = cmd.output()?; + if !out.status.success() { + let (status, stdout) = (out.status, String::from_utf8_lossy(&out.stdout)); + return Err(format!("command {cmd:?} failed, {status:?}\nstdout: {stdout}").into()); } - Ok(String::from_utf8(output.stdout)?) + Ok(String::from_utf8(out.stdout)?) } const RUST_LAYOUTS: &[(&str, Layout)] = &[ diff --git a/rust-bindings/tests/functions/mod.rs b/rust-bindings/tests/functions/mod.rs index 610ff78058..222696f3a6 100644 --- a/rust-bindings/tests/functions/mod.rs +++ b/rust-bindings/tests/functions/mod.rs @@ -30,7 +30,7 @@ fn list_repo_objects() { commit_cnt += 1; } x => { - panic!("unexpected object type {}", x); + panic!("unexpected object type {:?}", x); } } }