mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-09 01:18:35 +03:00
Update to glib 0.14
An intimidating spam of compiler errors at the start, but the biggest was handling the new convention of `ostree_sys::` => `ffi::`. This will require a semver bump of course.
This commit is contained in:
parent
f276c040bd
commit
8a5ac02822
@ -2,6 +2,7 @@
|
||||
name = "ostree"
|
||||
version = "0.11.0"
|
||||
authors = ["Felix Krull"]
|
||||
edition = "2018"
|
||||
|
||||
license = "MIT"
|
||||
description = "Rust bindings for libostree"
|
||||
@ -34,13 +35,13 @@ members = [".", "sys"]
|
||||
[dependencies]
|
||||
libc = "0.2"
|
||||
bitflags = "1.2.1"
|
||||
glib = "0.10.1"
|
||||
gio = "0.9.0"
|
||||
glib-sys = "0.10.0"
|
||||
gobject-sys = "0.10.0"
|
||||
gio-sys = "0.10.0"
|
||||
glib = "0.14.0"
|
||||
gio = "0.14.0"
|
||||
glib-sys = "0.14.0"
|
||||
gobject-sys = "0.14.0"
|
||||
gio-sys = "0.14.0"
|
||||
once_cell = "1.4.0"
|
||||
ostree-sys = { version = "0.7.3", path = "sys" }
|
||||
ffi = { package = "ostree-sys", path = "sys" }
|
||||
radix64 = "0.6.2"
|
||||
hex = "0.4.2"
|
||||
thiserror = "1.0.20"
|
||||
@ -51,43 +52,43 @@ openat = "0.1.19"
|
||||
tempfile = "3"
|
||||
|
||||
[features]
|
||||
dox = ["ostree-sys/dox"]
|
||||
v2014_9 = ["ostree-sys/v2014_9"]
|
||||
v2015_7 = ["v2014_9", "ostree-sys/v2015_7"]
|
||||
v2016_3 = ["v2015_7", "ostree-sys/v2016_3"]
|
||||
v2016_4 = ["v2015_7", "ostree-sys/v2016_4"]
|
||||
v2016_5 = ["v2016_4", "ostree-sys/v2016_5"]
|
||||
v2016_6 = ["v2016_5", "ostree-sys/v2016_6"]
|
||||
v2016_7 = ["v2016_6", "ostree-sys/v2016_7"]
|
||||
v2016_8 = ["v2016_7", "ostree-sys/v2016_8"]
|
||||
v2016_14 = ["v2016_8", "ostree-sys/v2016_14"]
|
||||
v2017_1 = ["v2016_14", "ostree-sys/v2017_1"]
|
||||
v2017_2 = ["v2017_1", "ostree-sys/v2017_2"]
|
||||
v2017_3 = ["v2017_2", "ostree-sys/v2017_3"]
|
||||
v2017_4 = ["v2017_3", "ostree-sys/v2017_4"]
|
||||
v2017_6 = ["v2017_4", "ostree-sys/v2017_6"]
|
||||
v2017_7 = ["v2017_6", "ostree-sys/v2017_7"]
|
||||
v2017_8 = ["v2017_7", "ostree-sys/v2017_8"]
|
||||
v2017_9 = ["v2017_8", "ostree-sys/v2017_9"]
|
||||
v2017_10 = ["v2017_9", "ostree-sys/v2017_10"]
|
||||
v2017_11 = ["v2017_10", "ostree-sys/v2017_11"]
|
||||
v2017_12 = ["v2017_11", "ostree-sys/v2017_12"]
|
||||
v2017_13 = ["v2017_12", "ostree-sys/v2017_13"]
|
||||
v2017_15 = ["v2017_13", "ostree-sys/v2017_15"]
|
||||
v2018_2 = ["v2017_15", "ostree-sys/v2018_2"]
|
||||
v2018_3 = ["v2018_2", "ostree-sys/v2018_3"]
|
||||
v2018_5 = ["v2018_3", "ostree-sys/v2018_5"]
|
||||
v2018_6 = ["v2018_5", "ostree-sys/v2018_6"]
|
||||
v2018_7 = ["v2018_6", "ostree-sys/v2018_7"]
|
||||
v2018_9 = ["v2018_7", "ostree-sys/v2018_9"]
|
||||
v2019_2 = ["v2018_9", "ostree-sys/v2019_2"]
|
||||
v2019_3 = ["v2019_2", "ostree-sys/v2019_3"]
|
||||
v2019_4 = ["v2019_3", "ostree-sys/v2019_4"]
|
||||
v2019_6 = ["v2019_4", "ostree-sys/v2019_6"]
|
||||
v2020_1 = ["v2019_6", "ostree-sys/v2020_1"]
|
||||
v2020_2 = ["v2020_1", "ostree-sys/v2020_2"]
|
||||
v2020_4 = ["v2020_2", "ostree-sys/v2020_4"]
|
||||
v2020_7 = ["v2020_4", "ostree-sys/v2020_7"]
|
||||
v2020_8 = ["v2020_7", "ostree-sys/v2020_8"]
|
||||
v2021_1 = ["v2020_8", "ostree-sys/v2021_1"]
|
||||
v2021_2 = ["v2020_1", "ostree-sys/v2021_2"]
|
||||
dox = ["ffi/dox"]
|
||||
v2014_9 = ["ffi/v2014_9"]
|
||||
v2015_7 = ["v2014_9", "ffi/v2015_7"]
|
||||
v2016_3 = ["v2015_7", "ffi/v2016_3"]
|
||||
v2016_4 = ["v2015_7", "ffi/v2016_4"]
|
||||
v2016_5 = ["v2016_4", "ffi/v2016_5"]
|
||||
v2016_6 = ["v2016_5", "ffi/v2016_6"]
|
||||
v2016_7 = ["v2016_6", "ffi/v2016_7"]
|
||||
v2016_8 = ["v2016_7", "ffi/v2016_8"]
|
||||
v2016_14 = ["v2016_8", "ffi/v2016_14"]
|
||||
v2017_1 = ["v2016_14", "ffi/v2017_1"]
|
||||
v2017_2 = ["v2017_1", "ffi/v2017_2"]
|
||||
v2017_3 = ["v2017_2", "ffi/v2017_3"]
|
||||
v2017_4 = ["v2017_3", "ffi/v2017_4"]
|
||||
v2017_6 = ["v2017_4", "ffi/v2017_6"]
|
||||
v2017_7 = ["v2017_6", "ffi/v2017_7"]
|
||||
v2017_8 = ["v2017_7", "ffi/v2017_8"]
|
||||
v2017_9 = ["v2017_8", "ffi/v2017_9"]
|
||||
v2017_10 = ["v2017_9", "ffi/v2017_10"]
|
||||
v2017_11 = ["v2017_10", "ffi/v2017_11"]
|
||||
v2017_12 = ["v2017_11", "ffi/v2017_12"]
|
||||
v2017_13 = ["v2017_12", "ffi/v2017_13"]
|
||||
v2017_15 = ["v2017_13", "ffi/v2017_15"]
|
||||
v2018_2 = ["v2017_15", "ffi/v2018_2"]
|
||||
v2018_3 = ["v2018_2", "ffi/v2018_3"]
|
||||
v2018_5 = ["v2018_3", "ffi/v2018_5"]
|
||||
v2018_6 = ["v2018_5", "ffi/v2018_6"]
|
||||
v2018_7 = ["v2018_6", "ffi/v2018_7"]
|
||||
v2018_9 = ["v2018_7", "ffi/v2018_9"]
|
||||
v2019_2 = ["v2018_9", "ffi/v2019_2"]
|
||||
v2019_3 = ["v2019_2", "ffi/v2019_3"]
|
||||
v2019_4 = ["v2019_3", "ffi/v2019_4"]
|
||||
v2019_6 = ["v2019_4", "ffi/v2019_6"]
|
||||
v2020_1 = ["v2019_6", "ffi/v2020_1"]
|
||||
v2020_2 = ["v2020_1", "ffi/v2020_2"]
|
||||
v2020_4 = ["v2020_2", "ffi/v2020_4"]
|
||||
v2020_7 = ["v2020_4", "ffi/v2020_7"]
|
||||
v2020_8 = ["v2020_7", "ffi/v2020_8"]
|
||||
v2021_1 = ["v2020_8", "ffi/v2021_1"]
|
||||
v2021_2 = ["v2020_1", "ffi/v2021_2"]
|
||||
|
@ -1,5 +1,5 @@
|
||||
GIR_REPO := https://github.com/gtk-rs/gir.git
|
||||
GIR_VERSION := 2d1ffab19eb5f9a2f0d7a294dbf07517dab4d989
|
||||
GIR_VERSION := e8f82cf63f2b2fba7af9440248510c4b7e5ab787
|
||||
OSTREE_REPO := ../ostree
|
||||
OSTREE_VERSION := patch-v2021.1
|
||||
RUSTDOC_STRIPPER_VERSION := 0.1.17
|
||||
|
@ -36,4 +36,4 @@ ignore = [
|
||||
"OSTree.BUILT_FEATURES",
|
||||
]
|
||||
|
||||
girs_dir = "../gir-files"
|
||||
girs_directories = [ "../gir-files" ]
|
||||
|
@ -13,7 +13,7 @@ deprecate_by_min_version = true
|
||||
single_version_file = true
|
||||
generate_display_trait = true
|
||||
|
||||
girs_dir = "../gir-files"
|
||||
girs_directories = [ "../gir-files" ]
|
||||
|
||||
generate = [
|
||||
"OSTree.AsyncProgress",
|
||||
@ -225,6 +225,11 @@ status = "generate"
|
||||
name = "opts"
|
||||
const = true
|
||||
|
||||
[[object.function]]
|
||||
# [IGNORE] overlaps with repo()
|
||||
name = "get_repo"
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "OSTree.*"
|
||||
status = "generate"
|
||||
|
265
rust-bindings/rust/src/auto/async_progress.rs
generated
265
rust-bindings/rust/src/auto/async_progress.rs
generated
@ -1,40 +1,147 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
use glib;
|
||||
use glib::object::Cast;
|
||||
use glib::object::IsA;
|
||||
use glib::object::ObjectType as ObjectType_;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::translate::*;
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
use glib::GString;
|
||||
use glib_sys;
|
||||
use ostree_sys;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::fmt;
|
||||
use std::mem::transmute;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct AsyncProgress(Object<ostree_sys::OstreeAsyncProgress, ostree_sys::OstreeAsyncProgressClass, AsyncProgressClass>);
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeAsyncProgress")]
|
||||
pub struct AsyncProgress(Object<ffi::OstreeAsyncProgress, ffi::OstreeAsyncProgressClass>);
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_async_progress_get_type(),
|
||||
type_ => || ffi::ostree_async_progress_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl AsyncProgress {
|
||||
#[doc(alias = "ostree_async_progress_new")]
|
||||
pub fn new() -> AsyncProgress {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_async_progress_new())
|
||||
from_glib_full(ffi::ostree_async_progress_new())
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "ostree_async_progress_new_and_connect")]
|
||||
//pub fn new_and_connect(changed: /*Unimplemented*/Option<Fundamental: Pointer>, user_data: /*Unimplemented*/Option<Fundamental: Pointer>) -> AsyncProgress {
|
||||
// unsafe { TODO: call ostree_sys:ostree_async_progress_new_and_connect() }
|
||||
// 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")))]
|
||||
#[doc(alias = "ostree_async_progress_copy_state")]
|
||||
pub fn copy_state(&self, dest: &AsyncProgress) {
|
||||
unsafe {
|
||||
ffi::ostree_async_progress_copy_state(self.to_glib_none().0, dest.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_async_progress_finish")]
|
||||
pub fn finish(&self) {
|
||||
unsafe {
|
||||
ffi::ostree_async_progress_finish(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
//#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))]
|
||||
//#[doc(alias = "ostree_async_progress_get")]
|
||||
//pub fn get(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: 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")))]
|
||||
#[doc(alias = "ostree_async_progress_get_status")]
|
||||
#[doc(alias = "get_status")]
|
||||
pub fn status(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ostree_async_progress_get_status(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_async_progress_get_uint")]
|
||||
#[doc(alias = "get_uint")]
|
||||
pub fn uint(&self, key: &str) -> u32 {
|
||||
unsafe {
|
||||
ffi::ostree_async_progress_get_uint(self.to_glib_none().0, key.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_async_progress_get_uint64")]
|
||||
#[doc(alias = "get_uint64")]
|
||||
pub fn uint64(&self, key: &str) -> u64 {
|
||||
unsafe {
|
||||
ffi::ostree_async_progress_get_uint64(self.to_glib_none().0, key.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))]
|
||||
#[doc(alias = "ostree_async_progress_get_variant")]
|
||||
#[doc(alias = "get_variant")]
|
||||
pub fn variant(&self, key: &str) -> Option<glib::Variant> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ostree_async_progress_get_variant(self.to_glib_none().0, key.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
//#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))]
|
||||
//#[doc(alias = "ostree_async_progress_set")]
|
||||
//pub fn set(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: 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")))]
|
||||
#[doc(alias = "ostree_async_progress_set_status")]
|
||||
pub fn set_status(&self, status: Option<&str>) {
|
||||
unsafe {
|
||||
ffi::ostree_async_progress_set_status(self.to_glib_none().0, status.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_async_progress_set_uint")]
|
||||
pub fn set_uint(&self, key: &str, value: u32) {
|
||||
unsafe {
|
||||
ffi::ostree_async_progress_set_uint(self.to_glib_none().0, key.to_glib_none().0, value);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_async_progress_set_uint64")]
|
||||
pub fn set_uint64(&self, key: &str, value: u64) {
|
||||
unsafe {
|
||||
ffi::ostree_async_progress_set_uint64(self.to_glib_none().0, key.to_glib_none().0, value);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_6")))]
|
||||
#[doc(alias = "ostree_async_progress_set_variant")]
|
||||
pub fn set_variant(&self, key: &str, value: &glib::Variant) {
|
||||
unsafe {
|
||||
ffi::ostree_async_progress_set_variant(self.to_glib_none().0, key.to_glib_none().0, value.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "changed")]
|
||||
pub fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn changed_trampoline<F: Fn(&AsyncProgress) + 'static>(this: *mut ffi::OstreeAsyncProgress, f: glib::ffi::gpointer) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this))
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = 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::<F> as *const ())), Box_::into_raw(f))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for AsyncProgress {
|
||||
@ -43,136 +150,8 @@ impl Default for AsyncProgress {
|
||||
}
|
||||
}
|
||||
|
||||
pub const NONE_ASYNC_PROGRESS: Option<&AsyncProgress> = None;
|
||||
|
||||
pub trait AsyncProgressExt: 'static {
|
||||
#[cfg(any(feature = "v2019_6", feature = "dox"))]
|
||||
fn copy_state<P: IsA<AsyncProgress>>(&self, dest: &P);
|
||||
|
||||
fn finish(&self);
|
||||
|
||||
//#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
//fn get(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
fn get_status(&self) -> Option<GString>;
|
||||
|
||||
fn get_uint(&self, key: &str) -> u32;
|
||||
|
||||
fn get_uint64(&self, key: &str) -> u64;
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
fn get_variant(&self, key: &str) -> Option<glib::Variant>;
|
||||
|
||||
//#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
//fn set(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
fn set_status(&self, status: Option<&str>);
|
||||
|
||||
fn set_uint(&self, key: &str, value: u32);
|
||||
|
||||
fn set_uint64(&self, key: &str, value: u64);
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
fn set_variant(&self, key: &str, value: &glib::Variant);
|
||||
|
||||
fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<AsyncProgress>> AsyncProgressExt for O {
|
||||
#[cfg(any(feature = "v2019_6", feature = "dox"))]
|
||||
fn copy_state<P: IsA<AsyncProgress>>(&self, dest: &P) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_async_progress_copy_state(self.as_ref().to_glib_none().0, dest.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn finish(&self) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_async_progress_finish(self.as_ref().to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
//#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
//fn get(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call ostree_sys:ostree_async_progress_get() }
|
||||
//}
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
fn get_status(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_async_progress_get_status(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_uint(&self, key: &str) -> u32 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_async_progress_get_uint(self.as_ref().to_glib_none().0, key.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_uint64(&self, key: &str) -> u64 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_async_progress_get_uint64(self.as_ref().to_glib_none().0, key.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
fn get_variant(&self, key: &str) -> Option<glib::Variant> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_async_progress_get_variant(self.as_ref().to_glib_none().0, key.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
//#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
//fn set(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call ostree_sys:ostree_async_progress_set() }
|
||||
//}
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
fn set_status(&self, status: Option<&str>) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_async_progress_set_status(self.as_ref().to_glib_none().0, status.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_uint(&self, key: &str, value: u32) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_async_progress_set_uint(self.as_ref().to_glib_none().0, key.to_glib_none().0, value);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_uint64(&self, key: &str, value: u64) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_async_progress_set_uint64(self.as_ref().to_glib_none().0, key.to_glib_none().0, value);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
fn set_variant(&self, key: &str, value: &glib::Variant) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_async_progress_set_variant(self.as_ref().to_glib_none().0, key.to_glib_none().0, value.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn changed_trampoline<P, F: Fn(&P) + 'static>(this: *mut ostree_sys::OstreeAsyncProgress, f: glib_sys::gpointer)
|
||||
where P: IsA<AsyncProgress>
|
||||
{
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&AsyncProgress::from_glib_borrow(this).unsafe_cast_ref())
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = 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::<Self, F> as *const ())), Box_::into_raw(f))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for AsyncProgress {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "AsyncProgress")
|
||||
f.write_str("AsyncProgress")
|
||||
}
|
||||
}
|
||||
|
52
rust-bindings/rust/src/auto/bootconfig_parser.rs
generated
52
rust-bindings/rust/src/auto/bootconfig_parser.rs
generated
@ -1,91 +1,101 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use gio;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct BootconfigParser(Object<ostree_sys::OstreeBootconfigParser, BootconfigParserClass>);
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeBootconfigParser")]
|
||||
pub struct BootconfigParser(Object<ffi::OstreeBootconfigParser>);
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_bootconfig_parser_get_type(),
|
||||
type_ => || ffi::ostree_bootconfig_parser_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl BootconfigParser {
|
||||
#[doc(alias = "ostree_bootconfig_parser_new")]
|
||||
pub fn new() -> BootconfigParser {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_bootconfig_parser_new())
|
||||
from_glib_full(ffi::ostree_bootconfig_parser_new())
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_bootconfig_parser_clone")]
|
||||
pub fn clone(&self) -> Option<BootconfigParser> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_bootconfig_parser_clone(self.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_bootconfig_parser_clone(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get(&self, key: &str) -> Option<GString> {
|
||||
#[doc(alias = "ostree_bootconfig_parser_get")]
|
||||
pub fn get(&self, key: &str) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_bootconfig_parser_get(self.to_glib_none().0, key.to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_bootconfig_parser_get(self.to_glib_none().0, key.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_7", feature = "dox"))]
|
||||
pub fn get_overlay_initrds(&self) -> Vec<GString> {
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))]
|
||||
#[doc(alias = "ostree_bootconfig_parser_get_overlay_initrds")]
|
||||
#[doc(alias = "get_overlay_initrds")]
|
||||
pub fn overlay_initrds(&self) -> Vec<glib::GString> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_none(ostree_sys::ostree_bootconfig_parser_get_overlay_initrds(self.to_glib_none().0))
|
||||
FromGlibPtrContainer::from_glib_none(ffi::ostree_bootconfig_parser_get_overlay_initrds(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_bootconfig_parser_parse")]
|
||||
pub fn parse<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, path: &P, cancellable: Option<&Q>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_bootconfig_parser_parse(self.to_glib_none().0, path.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_bootconfig_parser_parse_at")]
|
||||
pub fn parse_at<P: IsA<gio::Cancellable>>(&self, dfd: i32, path: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_bootconfig_parser_parse_at(self.to_glib_none().0, dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_bootconfig_parser_set")]
|
||||
pub fn set(&self, key: &str, value: &str) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_bootconfig_parser_set(self.to_glib_none().0, key.to_glib_none().0, value.to_glib_none().0);
|
||||
ffi::ostree_bootconfig_parser_set(self.to_glib_none().0, key.to_glib_none().0, value.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_7", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))]
|
||||
#[doc(alias = "ostree_bootconfig_parser_set_overlay_initrds")]
|
||||
pub fn set_overlay_initrds(&self, initrds: &[&str]) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_bootconfig_parser_set_overlay_initrds(self.to_glib_none().0, initrds.to_glib_none().0);
|
||||
ffi::ostree_bootconfig_parser_set_overlay_initrds(self.to_glib_none().0, initrds.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_bootconfig_parser_write")]
|
||||
pub fn write<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, output: &P, cancellable: Option<&Q>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_bootconfig_parser_write(self.to_glib_none().0, output.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_bootconfig_parser_write_at")]
|
||||
pub fn write_at<P: IsA<gio::Cancellable>>(&self, dfd: i32, path: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_bootconfig_parser_write_at(self.to_glib_none().0, dfd, path.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
@ -99,6 +109,6 @@ impl Default for BootconfigParser {
|
||||
|
||||
impl fmt::Display for BootconfigParser {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "BootconfigParser")
|
||||
f.write_str("BootconfigParser")
|
||||
}
|
||||
}
|
||||
|
29
rust-bindings/rust/src/auto/collection_ref.rs
generated
29
rust-bindings/rust/src/auto/collection_ref.rs
generated
@ -1,45 +1,40 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use glib::translate::*;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use ostree_sys;
|
||||
use std::hash;
|
||||
|
||||
glib_wrapper! {
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialOrd, Ord)]
|
||||
pub struct CollectionRef(Boxed<ostree_sys::OstreeCollectionRef>);
|
||||
pub struct CollectionRef(Boxed<ffi::OstreeCollectionRef>);
|
||||
|
||||
match fn {
|
||||
copy => |ptr| gobject_sys::g_boxed_copy(ostree_sys::ostree_collection_ref_get_type(), ptr as *mut _) as *mut ostree_sys::OstreeCollectionRef,
|
||||
free => |ptr| gobject_sys::g_boxed_free(ostree_sys::ostree_collection_ref_get_type(), ptr as *mut _),
|
||||
get_type => || ostree_sys::ostree_collection_ref_get_type(),
|
||||
copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::ostree_collection_ref_get_type(), ptr as *mut _) as *mut ffi::OstreeCollectionRef,
|
||||
free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::ostree_collection_ref_get_type(), ptr as *mut _),
|
||||
type_ => || ffi::ostree_collection_ref_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl CollectionRef {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[doc(alias = "ostree_collection_ref_new")]
|
||||
pub fn new(collection_id: Option<&str>, ref_name: &str) -> Option<CollectionRef> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_collection_ref_new(collection_id.to_glib_none().0, ref_name.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_collection_ref_new(collection_id.to_glib_none().0, ref_name.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[doc(alias = "ostree_collection_ref_equal")]
|
||||
fn equal(&self, ref2: &CollectionRef) -> bool {
|
||||
unsafe {
|
||||
from_glib(ostree_sys::ostree_collection_ref_equal(ToGlibPtr::<*const ostree_sys::OstreeCollectionRef>::to_glib_none(self).0 as glib_sys::gconstpointer, ToGlibPtr::<*const ostree_sys::OstreeCollectionRef>::to_glib_none(ref2).0 as glib_sys::gconstpointer))
|
||||
from_glib(ffi::ostree_collection_ref_equal(ToGlibPtr::<*const ffi::OstreeCollectionRef>::to_glib_none(self).0 as glib::ffi::gconstpointer, ToGlibPtr::<*const ffi::OstreeCollectionRef>::to_glib_none(ref2).0 as glib::ffi::gconstpointer))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[doc(alias = "ostree_collection_ref_hash")]
|
||||
fn hash(&self) -> u32 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_collection_ref_hash(ToGlibPtr::<*const ostree_sys::OstreeCollectionRef>::to_glib_none(self).0 as glib_sys::gconstpointer)
|
||||
ffi::ostree_collection_ref_hash(ToGlibPtr::<*const ffi::OstreeCollectionRef>::to_glib_none(self).0 as glib::ffi::gconstpointer)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
21
rust-bindings/rust/src/auto/commit_sizes_entry.rs
generated
21
rust-bindings/rust/src/auto/commit_sizes_entry.rs
generated
@ -1,29 +1,26 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(any(feature = "v2020_1", feature = "dox"))]
|
||||
use crate::ObjectType;
|
||||
use glib::translate::*;
|
||||
use ostree_sys;
|
||||
#[cfg(any(feature = "v2020_1", feature = "dox"))]
|
||||
use ObjectType;
|
||||
|
||||
glib_wrapper! {
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct CommitSizesEntry(Boxed<ostree_sys::OstreeCommitSizesEntry>);
|
||||
pub struct CommitSizesEntry(Boxed<ffi::OstreeCommitSizesEntry>);
|
||||
|
||||
match fn {
|
||||
copy => |ptr| ostree_sys::ostree_commit_sizes_entry_copy(mut_override(ptr)),
|
||||
free => |ptr| ostree_sys::ostree_commit_sizes_entry_free(ptr),
|
||||
get_type => || ostree_sys::ostree_commit_sizes_entry_get_type(),
|
||||
copy => |ptr| ffi::ostree_commit_sizes_entry_copy(ptr),
|
||||
free => |ptr| ffi::ostree_commit_sizes_entry_free(ptr),
|
||||
type_ => || ffi::ostree_commit_sizes_entry_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl CommitSizesEntry {
|
||||
#[cfg(any(feature = "v2020_1", feature = "dox"))]
|
||||
#[doc(alias = "ostree_commit_sizes_entry_new")]
|
||||
pub fn new(checksum: &str, objtype: ObjectType, unpacked: u64, archived: u64) -> Option<CommitSizesEntry> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_commit_sizes_entry_new(checksum.to_glib_none().0, objtype.to_glib(), unpacked, archived))
|
||||
from_glib_full(ffi::ostree_commit_sizes_entry_new(checksum.to_glib_none().0, objtype.into_glib(), unpacked, archived))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
73
rust-bindings/rust/src/auto/constants.rs
generated
73
rust-bindings/rust/src/auto/constants.rs
generated
@ -1,39 +1,70 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use ostree_sys;
|
||||
use std::ffi::CStr;
|
||||
|
||||
pub static COMMIT_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_GVARIANT_STRING).to_str().unwrap()});
|
||||
#[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"))]
|
||||
pub static COMMIT_META_KEY_ARCHITECTURE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_ARCHITECTURE).to_str().unwrap()});
|
||||
#[cfg_attr(feature = "dox", 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"))]
|
||||
pub static COMMIT_META_KEY_COLLECTION_BINDING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_COLLECTION_BINDING).to_str().unwrap()});
|
||||
#[cfg_attr(feature = "dox", 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"))]
|
||||
pub static COMMIT_META_KEY_ENDOFLIFE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_ENDOFLIFE).to_str().unwrap()});
|
||||
#[cfg_attr(feature = "dox", 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"))]
|
||||
pub static COMMIT_META_KEY_ENDOFLIFE_REBASE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE).to_str().unwrap()});
|
||||
#[cfg_attr(feature = "dox", 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"))]
|
||||
pub static COMMIT_META_KEY_REF_BINDING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_REF_BINDING).to_str().unwrap()});
|
||||
#[cfg_attr(feature = "dox", 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"))]
|
||||
pub static COMMIT_META_KEY_SOURCE_TITLE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_SOURCE_TITLE).to_str().unwrap()});
|
||||
#[cfg_attr(feature = "dox", 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"))]
|
||||
pub static COMMIT_META_KEY_VERSION: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_COMMIT_META_KEY_VERSION).to_str().unwrap()});
|
||||
pub static DIRMETA_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_DIRMETA_GVARIANT_STRING).to_str().unwrap()});
|
||||
pub static FILEMETA_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_FILEMETA_GVARIANT_STRING).to_str().unwrap()});
|
||||
#[cfg_attr(feature = "dox", 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()});
|
||||
#[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()});
|
||||
#[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()});
|
||||
#[cfg(any(feature = "v2021_1", feature = "dox"))]
|
||||
pub static METADATA_KEY_BOOTABLE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_METADATA_KEY_BOOTABLE).to_str().unwrap()});
|
||||
#[cfg_attr(feature = "dox", 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"))]
|
||||
pub static METADATA_KEY_LINUX: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_METADATA_KEY_LINUX).to_str().unwrap()});
|
||||
#[cfg_attr(feature = "dox", 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"))]
|
||||
pub static META_KEY_DEPLOY_COLLECTION_ID: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_META_KEY_DEPLOY_COLLECTION_ID).to_str().unwrap()});
|
||||
#[cfg_attr(feature = "dox", 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"))]
|
||||
pub static ORIGIN_TRANSIENT_GROUP: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_ORIGIN_TRANSIENT_GROUP).to_str().unwrap()});
|
||||
#[cfg_attr(feature = "dox", 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 = "v2018_6", feature = "dox"))]
|
||||
pub static REPO_METADATA_REF: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_REPO_METADATA_REF).to_str().unwrap()});
|
||||
#[cfg_attr(feature = "dox", 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"))]
|
||||
pub static SIGN_NAME_ED25519: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_SIGN_NAME_ED25519).to_str().unwrap()});
|
||||
pub static SUMMARY_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_SUMMARY_GVARIANT_STRING).to_str().unwrap()});
|
||||
pub static SUMMARY_SIG_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_SUMMARY_SIG_GVARIANT_STRING).to_str().unwrap()});
|
||||
pub static TREE_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ostree_sys::OSTREE_TREE_GVARIANT_STRING).to_str().unwrap()});
|
||||
#[cfg_attr(feature = "dox", 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()});
|
||||
#[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()});
|
||||
#[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()});
|
||||
#[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()});
|
||||
|
28
rust-bindings/rust/src/auto/content_writer.rs
generated
28
rust-bindings/rust/src/auto/content_writer.rs
generated
@ -1,35 +1,27 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use gio;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct ContentWriter(Object<ostree_sys::OstreeContentWriter, ostree_sys::OstreeContentWriterClass, ContentWriterClass>) @extends gio::OutputStream;
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeContentWriter")]
|
||||
pub struct ContentWriter(Object<ffi::OstreeContentWriter, ffi::OstreeContentWriterClass>) @extends gio::OutputStream;
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_content_writer_get_type(),
|
||||
type_ => || ffi::ostree_content_writer_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
pub const NONE_CONTENT_WRITER: Option<&ContentWriter> = None;
|
||||
|
||||
pub trait ContentWriterExt: 'static {
|
||||
fn finish<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<GString, glib::Error>;
|
||||
}
|
||||
|
||||
impl<O: IsA<ContentWriter>> ContentWriterExt for O {
|
||||
fn finish<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<GString, glib::Error> {
|
||||
impl ContentWriter {
|
||||
#[doc(alias = "ostree_content_writer_finish")]
|
||||
pub fn finish<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<glib::GString, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_content_writer_finish(self.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
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)) }
|
||||
}
|
||||
}
|
||||
@ -37,6 +29,6 @@ impl<O: IsA<ContentWriter>> ContentWriterExt for O {
|
||||
|
||||
impl fmt::Display for ContentWriter {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "ContentWriter")
|
||||
f.write_str("ContentWriter")
|
||||
}
|
||||
}
|
||||
|
127
rust-bindings/rust/src/auto/deployment.rs
generated
127
rust-bindings/rust/src/auto/deployment.rs
generated
@ -1,166 +1,201 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use glib_sys;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
use BootconfigParser;
|
||||
use crate::BootconfigParser;
|
||||
#[cfg(any(feature = "v2016_4", feature = "dox"))]
|
||||
use DeploymentUnlockedState;
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
|
||||
use crate::DeploymentUnlockedState;
|
||||
use glib::translate::*;
|
||||
use std::fmt;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Deployment(Object<ostree_sys::OstreeDeployment, DeploymentClass>);
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeDeployment")]
|
||||
pub struct Deployment(Object<ffi::OstreeDeployment>);
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_deployment_get_type(),
|
||||
type_ => || ffi::ostree_deployment_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Deployment {
|
||||
#[doc(alias = "ostree_deployment_new")]
|
||||
pub fn new(index: i32, osname: &str, csum: &str, deployserial: i32, bootcsum: Option<&str>, bootserial: i32) -> Deployment {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_deployment_new(index, osname.to_glib_none().0, csum.to_glib_none().0, deployserial, bootcsum.to_glib_none().0, bootserial))
|
||||
from_glib_full(ffi::ostree_deployment_new(index, osname.to_glib_none().0, csum.to_glib_none().0, deployserial, bootcsum.to_glib_none().0, bootserial))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_deployment_clone")]
|
||||
pub fn clone(&self) -> Option<Deployment> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_deployment_clone(self.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_deployment_clone(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_deployment_equal")]
|
||||
pub fn equal(&self, bp: &Deployment) -> bool {
|
||||
unsafe {
|
||||
from_glib(ostree_sys::ostree_deployment_equal(ToGlibPtr::<*mut ostree_sys::OstreeDeployment>::to_glib_none(self).0 as glib_sys::gconstpointer, ToGlibPtr::<*mut ostree_sys::OstreeDeployment>::to_glib_none(bp).0 as glib_sys::gconstpointer))
|
||||
from_glib(ffi::ostree_deployment_equal(ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(self).0 as glib::ffi::gconstpointer, ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(bp).0 as glib::ffi::gconstpointer))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_bootconfig(&self) -> Option<BootconfigParser> {
|
||||
#[doc(alias = "ostree_deployment_get_bootconfig")]
|
||||
#[doc(alias = "get_bootconfig")]
|
||||
pub fn bootconfig(&self) -> Option<BootconfigParser> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_deployment_get_bootconfig(self.to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_deployment_get_bootconfig(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_bootcsum(&self) -> Option<GString> {
|
||||
#[doc(alias = "ostree_deployment_get_bootcsum")]
|
||||
#[doc(alias = "get_bootcsum")]
|
||||
pub fn bootcsum(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_deployment_get_bootcsum(self.to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_deployment_get_bootcsum(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_bootserial(&self) -> i32 {
|
||||
#[doc(alias = "ostree_deployment_get_bootserial")]
|
||||
#[doc(alias = "get_bootserial")]
|
||||
pub fn bootserial(&self) -> i32 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_deployment_get_bootserial(self.to_glib_none().0)
|
||||
ffi::ostree_deployment_get_bootserial(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_csum(&self) -> Option<GString> {
|
||||
#[doc(alias = "ostree_deployment_get_csum")]
|
||||
#[doc(alias = "get_csum")]
|
||||
pub fn csum(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_deployment_get_csum(self.to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_deployment_get_csum(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_deployserial(&self) -> i32 {
|
||||
#[doc(alias = "ostree_deployment_get_deployserial")]
|
||||
#[doc(alias = "get_deployserial")]
|
||||
pub fn deployserial(&self) -> i32 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_deployment_get_deployserial(self.to_glib_none().0)
|
||||
ffi::ostree_deployment_get_deployserial(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_index(&self) -> i32 {
|
||||
#[doc(alias = "ostree_deployment_get_index")]
|
||||
#[doc(alias = "get_index")]
|
||||
pub fn index(&self) -> i32 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_deployment_get_index(self.to_glib_none().0)
|
||||
ffi::ostree_deployment_get_index(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_origin(&self) -> Option<glib::KeyFile> {
|
||||
#[doc(alias = "ostree_deployment_get_origin")]
|
||||
#[doc(alias = "get_origin")]
|
||||
pub fn origin(&self) -> Option<glib::KeyFile> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_deployment_get_origin(self.to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_deployment_get_origin(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_origin_relpath(&self) -> Option<GString> {
|
||||
#[doc(alias = "ostree_deployment_get_origin_relpath")]
|
||||
#[doc(alias = "get_origin_relpath")]
|
||||
pub fn origin_relpath(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_deployment_get_origin_relpath(self.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_deployment_get_origin_relpath(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_osname(&self) -> Option<GString> {
|
||||
#[doc(alias = "ostree_deployment_get_osname")]
|
||||
#[doc(alias = "get_osname")]
|
||||
pub fn osname(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_deployment_get_osname(self.to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_deployment_get_osname(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2016_4", feature = "dox"))]
|
||||
pub fn get_unlocked(&self) -> DeploymentUnlockedState {
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
|
||||
#[doc(alias = "ostree_deployment_get_unlocked")]
|
||||
#[doc(alias = "get_unlocked")]
|
||||
pub fn unlocked(&self) -> DeploymentUnlockedState {
|
||||
unsafe {
|
||||
from_glib(ostree_sys::ostree_deployment_get_unlocked(self.to_glib_none().0))
|
||||
from_glib(ffi::ostree_deployment_get_unlocked(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_deployment_hash")]
|
||||
pub fn hash(&self) -> u32 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_deployment_hash(ToGlibPtr::<*mut ostree_sys::OstreeDeployment>::to_glib_none(self).0 as glib_sys::gconstpointer)
|
||||
ffi::ostree_deployment_hash(ToGlibPtr::<*mut ffi::OstreeDeployment>::to_glib_none(self).0 as glib::ffi::gconstpointer)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_3", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))]
|
||||
#[doc(alias = "ostree_deployment_is_pinned")]
|
||||
pub fn is_pinned(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ostree_sys::ostree_deployment_is_pinned(self.to_glib_none().0))
|
||||
from_glib(ffi::ostree_deployment_is_pinned(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_3", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))]
|
||||
#[doc(alias = "ostree_deployment_is_staged")]
|
||||
pub fn is_staged(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ostree_sys::ostree_deployment_is_staged(self.to_glib_none().0))
|
||||
from_glib(ffi::ostree_deployment_is_staged(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_deployment_set_bootconfig")]
|
||||
pub fn set_bootconfig(&self, bootconfig: Option<&BootconfigParser>) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_deployment_set_bootconfig(self.to_glib_none().0, bootconfig.to_glib_none().0);
|
||||
ffi::ostree_deployment_set_bootconfig(self.to_glib_none().0, bootconfig.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_deployment_set_bootserial")]
|
||||
pub fn set_bootserial(&self, index: i32) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_deployment_set_bootserial(self.to_glib_none().0, index);
|
||||
ffi::ostree_deployment_set_bootserial(self.to_glib_none().0, index);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_deployment_set_index")]
|
||||
pub fn set_index(&self, index: i32) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_deployment_set_index(self.to_glib_none().0, index);
|
||||
ffi::ostree_deployment_set_index(self.to_glib_none().0, index);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_deployment_set_origin")]
|
||||
pub fn set_origin(&self, origin: Option<&glib::KeyFile>) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_deployment_set_origin(self.to_glib_none().0, origin.to_glib_none().0);
|
||||
ffi::ostree_deployment_set_origin(self.to_glib_none().0, origin.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_3", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))]
|
||||
#[doc(alias = "ostree_deployment_origin_remove_transient_state")]
|
||||
pub fn origin_remove_transient_state(origin: &glib::KeyFile) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_deployment_origin_remove_transient_state(origin.to_glib_none().0);
|
||||
ffi::ostree_deployment_origin_remove_transient_state(origin.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2016_4", feature = "dox"))]
|
||||
pub fn unlocked_state_to_string(state: DeploymentUnlockedState) -> Option<GString> {
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
|
||||
#[doc(alias = "ostree_deployment_unlocked_state_to_string")]
|
||||
pub fn unlocked_state_to_string(state: DeploymentUnlockedState) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_deployment_unlocked_state_to_string(state.to_glib()))
|
||||
from_glib_none(ffi::ostree_deployment_unlocked_state_to_string(state.into_glib()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Deployment {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "Deployment")
|
||||
f.write_str("Deployment")
|
||||
}
|
||||
}
|
||||
|
14
rust-bindings/rust/src/auto/diff_item.rs
generated
14
rust-bindings/rust/src/auto/diff_item.rs
generated
@ -1,17 +1,15 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib::translate::*;
|
||||
use ostree_sys;
|
||||
|
||||
glib_wrapper! {
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct DiffItem(Shared<ostree_sys::OstreeDiffItem>);
|
||||
pub struct DiffItem(Shared<ffi::OstreeDiffItem>);
|
||||
|
||||
match fn {
|
||||
ref => |ptr| ostree_sys::ostree_diff_item_ref(ptr),
|
||||
unref => |ptr| ostree_sys::ostree_diff_item_unref(ptr),
|
||||
get_type => || ostree_sys::ostree_diff_item_get_type(),
|
||||
ref => |ptr| ffi::ostree_diff_item_ref(ptr),
|
||||
unref => |ptr| ffi::ostree_diff_item_unref(ptr),
|
||||
type_ => || ffi::ostree_diff_item_get_type(),
|
||||
}
|
||||
}
|
||||
|
617
rust-bindings/rust/src/auto/enums.rs
generated
617
rust-bindings/rust/src/auto/enums.rs
generated
@ -1,612 +1,677 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib::translate::*;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "OstreeDeploymentUnlockedState")]
|
||||
pub enum DeploymentUnlockedState {
|
||||
#[doc(alias = "OSTREE_DEPLOYMENT_UNLOCKED_NONE")]
|
||||
None,
|
||||
#[doc(alias = "OSTREE_DEPLOYMENT_UNLOCKED_DEVELOPMENT")]
|
||||
Development,
|
||||
#[doc(alias = "OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX")]
|
||||
Hotfix,
|
||||
#[doc(alias = "OSTREE_DEPLOYMENT_UNLOCKED_TRANSIENT")]
|
||||
Transient,
|
||||
#[doc(hidden)]
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl fmt::Display for DeploymentUnlockedState {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "DeploymentUnlockedState::{}", match *self {
|
||||
DeploymentUnlockedState::None => "None",
|
||||
DeploymentUnlockedState::Development => "Development",
|
||||
DeploymentUnlockedState::Hotfix => "Hotfix",
|
||||
DeploymentUnlockedState::Transient => "Transient",
|
||||
Self::None => "None",
|
||||
Self::Development => "Development",
|
||||
Self::Hotfix => "Hotfix",
|
||||
Self::Transient => "Transient",
|
||||
_ => "Unknown",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for DeploymentUnlockedState {
|
||||
type GlibType = ostree_sys::OstreeDeploymentUnlockedState;
|
||||
impl IntoGlib for DeploymentUnlockedState {
|
||||
type GlibType = ffi::OstreeDeploymentUnlockedState;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeDeploymentUnlockedState {
|
||||
match *self {
|
||||
DeploymentUnlockedState::None => ostree_sys::OSTREE_DEPLOYMENT_UNLOCKED_NONE,
|
||||
DeploymentUnlockedState::Development => ostree_sys::OSTREE_DEPLOYMENT_UNLOCKED_DEVELOPMENT,
|
||||
DeploymentUnlockedState::Hotfix => ostree_sys::OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX,
|
||||
DeploymentUnlockedState::Transient => ostree_sys::OSTREE_DEPLOYMENT_UNLOCKED_TRANSIENT,
|
||||
DeploymentUnlockedState::__Unknown(value) => value
|
||||
}
|
||||
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<ostree_sys::OstreeDeploymentUnlockedState> for DeploymentUnlockedState {
|
||||
fn from_glib(value: ostree_sys::OstreeDeploymentUnlockedState) -> Self {
|
||||
impl FromGlib<ffi::OstreeDeploymentUnlockedState> for DeploymentUnlockedState {
|
||||
unsafe fn from_glib(value: ffi::OstreeDeploymentUnlockedState) -> Self {
|
||||
match value {
|
||||
0 => DeploymentUnlockedState::None,
|
||||
1 => DeploymentUnlockedState::Development,
|
||||
2 => DeploymentUnlockedState::Hotfix,
|
||||
3 => DeploymentUnlockedState::Transient,
|
||||
value => DeploymentUnlockedState::__Unknown(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)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "OstreeGpgSignatureAttr")]
|
||||
pub enum GpgSignatureAttr {
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_VALID")]
|
||||
Valid,
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_SIG_EXPIRED")]
|
||||
SigExpired,
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_KEY_EXPIRED")]
|
||||
KeyExpired,
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_KEY_REVOKED")]
|
||||
KeyRevoked,
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_KEY_MISSING")]
|
||||
KeyMissing,
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT")]
|
||||
Fingerprint,
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_TIMESTAMP")]
|
||||
Timestamp,
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_EXP_TIMESTAMP")]
|
||||
ExpTimestamp,
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_PUBKEY_ALGO_NAME")]
|
||||
PubkeyAlgoName,
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_HASH_ALGO_NAME")]
|
||||
HashAlgoName,
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_USER_NAME")]
|
||||
UserName,
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_USER_EMAIL")]
|
||||
UserEmail,
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT_PRIMARY")]
|
||||
FingerprintPrimary,
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP")]
|
||||
KeyExpTimestamp,
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP_PRIMARY")]
|
||||
KeyExpTimestampPrimary,
|
||||
#[doc(hidden)]
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl fmt::Display for GpgSignatureAttr {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "GpgSignatureAttr::{}", match *self {
|
||||
GpgSignatureAttr::Valid => "Valid",
|
||||
GpgSignatureAttr::SigExpired => "SigExpired",
|
||||
GpgSignatureAttr::KeyExpired => "KeyExpired",
|
||||
GpgSignatureAttr::KeyRevoked => "KeyRevoked",
|
||||
GpgSignatureAttr::KeyMissing => "KeyMissing",
|
||||
GpgSignatureAttr::Fingerprint => "Fingerprint",
|
||||
GpgSignatureAttr::Timestamp => "Timestamp",
|
||||
GpgSignatureAttr::ExpTimestamp => "ExpTimestamp",
|
||||
GpgSignatureAttr::PubkeyAlgoName => "PubkeyAlgoName",
|
||||
GpgSignatureAttr::HashAlgoName => "HashAlgoName",
|
||||
GpgSignatureAttr::UserName => "UserName",
|
||||
GpgSignatureAttr::UserEmail => "UserEmail",
|
||||
GpgSignatureAttr::FingerprintPrimary => "FingerprintPrimary",
|
||||
GpgSignatureAttr::KeyExpTimestamp => "KeyExpTimestamp",
|
||||
GpgSignatureAttr::KeyExpTimestampPrimary => "KeyExpTimestampPrimary",
|
||||
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 ToGlib for GpgSignatureAttr {
|
||||
type GlibType = ostree_sys::OstreeGpgSignatureAttr;
|
||||
impl IntoGlib for GpgSignatureAttr {
|
||||
type GlibType = ffi::OstreeGpgSignatureAttr;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeGpgSignatureAttr {
|
||||
match *self {
|
||||
GpgSignatureAttr::Valid => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_VALID,
|
||||
GpgSignatureAttr::SigExpired => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_SIG_EXPIRED,
|
||||
GpgSignatureAttr::KeyExpired => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXPIRED,
|
||||
GpgSignatureAttr::KeyRevoked => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_KEY_REVOKED,
|
||||
GpgSignatureAttr::KeyMissing => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_KEY_MISSING,
|
||||
GpgSignatureAttr::Fingerprint => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT,
|
||||
GpgSignatureAttr::Timestamp => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_TIMESTAMP,
|
||||
GpgSignatureAttr::ExpTimestamp => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_EXP_TIMESTAMP,
|
||||
GpgSignatureAttr::PubkeyAlgoName => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_PUBKEY_ALGO_NAME,
|
||||
GpgSignatureAttr::HashAlgoName => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_HASH_ALGO_NAME,
|
||||
GpgSignatureAttr::UserName => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_USER_NAME,
|
||||
GpgSignatureAttr::UserEmail => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_USER_EMAIL,
|
||||
GpgSignatureAttr::FingerprintPrimary => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT_PRIMARY,
|
||||
GpgSignatureAttr::KeyExpTimestamp => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP,
|
||||
GpgSignatureAttr::KeyExpTimestampPrimary => ostree_sys::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP_PRIMARY,
|
||||
GpgSignatureAttr::__Unknown(value) => value
|
||||
}
|
||||
fn into_glib(self) -> ffi::OstreeGpgSignatureAttr {
|
||||
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,
|
||||
Self::KeyRevoked => ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_REVOKED,
|
||||
Self::KeyMissing => ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_MISSING,
|
||||
Self::Fingerprint => ffi::OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT,
|
||||
Self::Timestamp => ffi::OSTREE_GPG_SIGNATURE_ATTR_TIMESTAMP,
|
||||
Self::ExpTimestamp => ffi::OSTREE_GPG_SIGNATURE_ATTR_EXP_TIMESTAMP,
|
||||
Self::PubkeyAlgoName => ffi::OSTREE_GPG_SIGNATURE_ATTR_PUBKEY_ALGO_NAME,
|
||||
Self::HashAlgoName => ffi::OSTREE_GPG_SIGNATURE_ATTR_HASH_ALGO_NAME,
|
||||
Self::UserName => ffi::OSTREE_GPG_SIGNATURE_ATTR_USER_NAME,
|
||||
Self::UserEmail => ffi::OSTREE_GPG_SIGNATURE_ATTR_USER_EMAIL,
|
||||
Self::FingerprintPrimary => ffi::OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT_PRIMARY,
|
||||
Self::KeyExpTimestamp => ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP,
|
||||
Self::KeyExpTimestampPrimary => ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP_PRIMARY,
|
||||
Self::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeGpgSignatureAttr> for GpgSignatureAttr {
|
||||
fn from_glib(value: ostree_sys::OstreeGpgSignatureAttr) -> Self {
|
||||
impl FromGlib<ffi::OstreeGpgSignatureAttr> for GpgSignatureAttr {
|
||||
unsafe fn from_glib(value: ffi::OstreeGpgSignatureAttr) -> Self {
|
||||
match value {
|
||||
0 => GpgSignatureAttr::Valid,
|
||||
1 => GpgSignatureAttr::SigExpired,
|
||||
2 => GpgSignatureAttr::KeyExpired,
|
||||
3 => GpgSignatureAttr::KeyRevoked,
|
||||
4 => GpgSignatureAttr::KeyMissing,
|
||||
5 => GpgSignatureAttr::Fingerprint,
|
||||
6 => GpgSignatureAttr::Timestamp,
|
||||
7 => GpgSignatureAttr::ExpTimestamp,
|
||||
8 => GpgSignatureAttr::PubkeyAlgoName,
|
||||
9 => GpgSignatureAttr::HashAlgoName,
|
||||
10 => GpgSignatureAttr::UserName,
|
||||
11 => GpgSignatureAttr::UserEmail,
|
||||
12 => GpgSignatureAttr::FingerprintPrimary,
|
||||
13 => GpgSignatureAttr::KeyExpTimestamp,
|
||||
14 => GpgSignatureAttr::KeyExpTimestampPrimary,
|
||||
value => GpgSignatureAttr::__Unknown(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,
|
||||
ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_REVOKED => Self::KeyRevoked,
|
||||
ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_MISSING => Self::KeyMissing,
|
||||
ffi::OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT => Self::Fingerprint,
|
||||
ffi::OSTREE_GPG_SIGNATURE_ATTR_TIMESTAMP => Self::Timestamp,
|
||||
ffi::OSTREE_GPG_SIGNATURE_ATTR_EXP_TIMESTAMP => Self::ExpTimestamp,
|
||||
ffi::OSTREE_GPG_SIGNATURE_ATTR_PUBKEY_ALGO_NAME => Self::PubkeyAlgoName,
|
||||
ffi::OSTREE_GPG_SIGNATURE_ATTR_HASH_ALGO_NAME => Self::HashAlgoName,
|
||||
ffi::OSTREE_GPG_SIGNATURE_ATTR_USER_NAME => Self::UserName,
|
||||
ffi::OSTREE_GPG_SIGNATURE_ATTR_USER_EMAIL => Self::UserEmail,
|
||||
ffi::OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT_PRIMARY => Self::FingerprintPrimary,
|
||||
ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP => Self::KeyExpTimestamp,
|
||||
ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP_PRIMARY => Self::KeyExpTimestampPrimary,
|
||||
value => Self::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "OstreeObjectType")]
|
||||
pub enum ObjectType {
|
||||
#[doc(alias = "OSTREE_OBJECT_TYPE_FILE")]
|
||||
File,
|
||||
#[doc(alias = "OSTREE_OBJECT_TYPE_DIR_TREE")]
|
||||
DirTree,
|
||||
#[doc(alias = "OSTREE_OBJECT_TYPE_DIR_META")]
|
||||
DirMeta,
|
||||
#[doc(alias = "OSTREE_OBJECT_TYPE_COMMIT")]
|
||||
Commit,
|
||||
#[doc(alias = "OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT")]
|
||||
TombstoneCommit,
|
||||
#[doc(alias = "OSTREE_OBJECT_TYPE_COMMIT_META")]
|
||||
CommitMeta,
|
||||
#[doc(alias = "OSTREE_OBJECT_TYPE_PAYLOAD_LINK")]
|
||||
PayloadLink,
|
||||
#[doc(hidden)]
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl fmt::Display for ObjectType {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "ObjectType::{}", match *self {
|
||||
ObjectType::File => "File",
|
||||
ObjectType::DirTree => "DirTree",
|
||||
ObjectType::DirMeta => "DirMeta",
|
||||
ObjectType::Commit => "Commit",
|
||||
ObjectType::TombstoneCommit => "TombstoneCommit",
|
||||
ObjectType::CommitMeta => "CommitMeta",
|
||||
ObjectType::PayloadLink => "PayloadLink",
|
||||
Self::File => "File",
|
||||
Self::DirTree => "DirTree",
|
||||
Self::DirMeta => "DirMeta",
|
||||
Self::Commit => "Commit",
|
||||
Self::TombstoneCommit => "TombstoneCommit",
|
||||
Self::CommitMeta => "CommitMeta",
|
||||
Self::PayloadLink => "PayloadLink",
|
||||
_ => "Unknown",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for ObjectType {
|
||||
type GlibType = ostree_sys::OstreeObjectType;
|
||||
impl IntoGlib for ObjectType {
|
||||
type GlibType = ffi::OstreeObjectType;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeObjectType {
|
||||
match *self {
|
||||
ObjectType::File => ostree_sys::OSTREE_OBJECT_TYPE_FILE,
|
||||
ObjectType::DirTree => ostree_sys::OSTREE_OBJECT_TYPE_DIR_TREE,
|
||||
ObjectType::DirMeta => ostree_sys::OSTREE_OBJECT_TYPE_DIR_META,
|
||||
ObjectType::Commit => ostree_sys::OSTREE_OBJECT_TYPE_COMMIT,
|
||||
ObjectType::TombstoneCommit => ostree_sys::OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT,
|
||||
ObjectType::CommitMeta => ostree_sys::OSTREE_OBJECT_TYPE_COMMIT_META,
|
||||
ObjectType::PayloadLink => ostree_sys::OSTREE_OBJECT_TYPE_PAYLOAD_LINK,
|
||||
ObjectType::__Unknown(value) => value
|
||||
}
|
||||
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,
|
||||
Self::Commit => ffi::OSTREE_OBJECT_TYPE_COMMIT,
|
||||
Self::TombstoneCommit => ffi::OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT,
|
||||
Self::CommitMeta => ffi::OSTREE_OBJECT_TYPE_COMMIT_META,
|
||||
Self::PayloadLink => ffi::OSTREE_OBJECT_TYPE_PAYLOAD_LINK,
|
||||
Self::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeObjectType> for ObjectType {
|
||||
fn from_glib(value: ostree_sys::OstreeObjectType) -> Self {
|
||||
impl FromGlib<ffi::OstreeObjectType> for ObjectType {
|
||||
unsafe fn from_glib(value: ffi::OstreeObjectType) -> Self {
|
||||
match value {
|
||||
1 => ObjectType::File,
|
||||
2 => ObjectType::DirTree,
|
||||
3 => ObjectType::DirMeta,
|
||||
4 => ObjectType::Commit,
|
||||
5 => ObjectType::TombstoneCommit,
|
||||
6 => ObjectType::CommitMeta,
|
||||
7 => ObjectType::PayloadLink,
|
||||
value => ObjectType::__Unknown(value),
|
||||
}
|
||||
ffi::OSTREE_OBJECT_TYPE_FILE => Self::File,
|
||||
ffi::OSTREE_OBJECT_TYPE_DIR_TREE => Self::DirTree,
|
||||
ffi::OSTREE_OBJECT_TYPE_DIR_META => Self::DirMeta,
|
||||
ffi::OSTREE_OBJECT_TYPE_COMMIT => Self::Commit,
|
||||
ffi::OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT => Self::TombstoneCommit,
|
||||
ffi::OSTREE_OBJECT_TYPE_COMMIT_META => Self::CommitMeta,
|
||||
ffi::OSTREE_OBJECT_TYPE_PAYLOAD_LINK => Self::PayloadLink,
|
||||
value => Self::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_2", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))]
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "OstreeRepoCheckoutFilterResult")]
|
||||
pub enum RepoCheckoutFilterResult {
|
||||
#[doc(alias = "OSTREE_REPO_CHECKOUT_FILTER_ALLOW")]
|
||||
Allow,
|
||||
#[doc(alias = "OSTREE_REPO_CHECKOUT_FILTER_SKIP")]
|
||||
Skip,
|
||||
#[doc(hidden)]
|
||||
#[doc(hidden)]
|
||||
__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 {
|
||||
RepoCheckoutFilterResult::Allow => "Allow",
|
||||
RepoCheckoutFilterResult::Skip => "Skip",
|
||||
Self::Allow => "Allow",
|
||||
Self::Skip => "Skip",
|
||||
_ => "Unknown",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_2", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))]
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCheckoutFilterResult {
|
||||
type GlibType = ostree_sys::OstreeRepoCheckoutFilterResult;
|
||||
impl IntoGlib for RepoCheckoutFilterResult {
|
||||
type GlibType = ffi::OstreeRepoCheckoutFilterResult;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoCheckoutFilterResult {
|
||||
match *self {
|
||||
RepoCheckoutFilterResult::Allow => ostree_sys::OSTREE_REPO_CHECKOUT_FILTER_ALLOW,
|
||||
RepoCheckoutFilterResult::Skip => ostree_sys::OSTREE_REPO_CHECKOUT_FILTER_SKIP,
|
||||
RepoCheckoutFilterResult::__Unknown(value) => value
|
||||
}
|
||||
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")))]
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoCheckoutFilterResult> for RepoCheckoutFilterResult {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoCheckoutFilterResult) -> Self {
|
||||
impl FromGlib<ffi::OstreeRepoCheckoutFilterResult> for RepoCheckoutFilterResult {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoCheckoutFilterResult) -> Self {
|
||||
match value {
|
||||
0 => RepoCheckoutFilterResult::Allow,
|
||||
1 => RepoCheckoutFilterResult::Skip,
|
||||
value => RepoCheckoutFilterResult::__Unknown(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)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "OstreeRepoCheckoutMode")]
|
||||
pub enum RepoCheckoutMode {
|
||||
#[doc(alias = "OSTREE_REPO_CHECKOUT_MODE_NONE")]
|
||||
None,
|
||||
#[doc(alias = "OSTREE_REPO_CHECKOUT_MODE_USER")]
|
||||
User,
|
||||
#[doc(hidden)]
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoCheckoutMode {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoCheckoutMode::{}", match *self {
|
||||
RepoCheckoutMode::None => "None",
|
||||
RepoCheckoutMode::User => "User",
|
||||
Self::None => "None",
|
||||
Self::User => "User",
|
||||
_ => "Unknown",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCheckoutMode {
|
||||
type GlibType = ostree_sys::OstreeRepoCheckoutMode;
|
||||
impl IntoGlib for RepoCheckoutMode {
|
||||
type GlibType = ffi::OstreeRepoCheckoutMode;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoCheckoutMode {
|
||||
match *self {
|
||||
RepoCheckoutMode::None => ostree_sys::OSTREE_REPO_CHECKOUT_MODE_NONE,
|
||||
RepoCheckoutMode::User => ostree_sys::OSTREE_REPO_CHECKOUT_MODE_USER,
|
||||
RepoCheckoutMode::__Unknown(value) => value
|
||||
}
|
||||
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<ostree_sys::OstreeRepoCheckoutMode> for RepoCheckoutMode {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoCheckoutMode) -> Self {
|
||||
impl FromGlib<ffi::OstreeRepoCheckoutMode> for RepoCheckoutMode {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoCheckoutMode) -> Self {
|
||||
match value {
|
||||
0 => RepoCheckoutMode::None,
|
||||
1 => RepoCheckoutMode::User,
|
||||
value => RepoCheckoutMode::__Unknown(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)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "OstreeRepoCheckoutOverwriteMode")]
|
||||
pub enum RepoCheckoutOverwriteMode {
|
||||
#[doc(alias = "OSTREE_REPO_CHECKOUT_OVERWRITE_NONE")]
|
||||
None,
|
||||
#[doc(alias = "OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES")]
|
||||
UnionFiles,
|
||||
#[doc(alias = "OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES")]
|
||||
AddFiles,
|
||||
#[doc(alias = "OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL")]
|
||||
UnionIdentical,
|
||||
#[doc(hidden)]
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoCheckoutOverwriteMode {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoCheckoutOverwriteMode::{}", match *self {
|
||||
RepoCheckoutOverwriteMode::None => "None",
|
||||
RepoCheckoutOverwriteMode::UnionFiles => "UnionFiles",
|
||||
RepoCheckoutOverwriteMode::AddFiles => "AddFiles",
|
||||
RepoCheckoutOverwriteMode::UnionIdentical => "UnionIdentical",
|
||||
Self::None => "None",
|
||||
Self::UnionFiles => "UnionFiles",
|
||||
Self::AddFiles => "AddFiles",
|
||||
Self::UnionIdentical => "UnionIdentical",
|
||||
_ => "Unknown",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCheckoutOverwriteMode {
|
||||
type GlibType = ostree_sys::OstreeRepoCheckoutOverwriteMode;
|
||||
impl IntoGlib for RepoCheckoutOverwriteMode {
|
||||
type GlibType = ffi::OstreeRepoCheckoutOverwriteMode;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoCheckoutOverwriteMode {
|
||||
match *self {
|
||||
RepoCheckoutOverwriteMode::None => ostree_sys::OSTREE_REPO_CHECKOUT_OVERWRITE_NONE,
|
||||
RepoCheckoutOverwriteMode::UnionFiles => ostree_sys::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES,
|
||||
RepoCheckoutOverwriteMode::AddFiles => ostree_sys::OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES,
|
||||
RepoCheckoutOverwriteMode::UnionIdentical => ostree_sys::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL,
|
||||
RepoCheckoutOverwriteMode::__Unknown(value) => value
|
||||
}
|
||||
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<ostree_sys::OstreeRepoCheckoutOverwriteMode> for RepoCheckoutOverwriteMode {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoCheckoutOverwriteMode) -> Self {
|
||||
impl FromGlib<ffi::OstreeRepoCheckoutOverwriteMode> for RepoCheckoutOverwriteMode {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoCheckoutOverwriteMode) -> Self {
|
||||
match value {
|
||||
0 => RepoCheckoutOverwriteMode::None,
|
||||
1 => RepoCheckoutOverwriteMode::UnionFiles,
|
||||
2 => RepoCheckoutOverwriteMode::AddFiles,
|
||||
3 => RepoCheckoutOverwriteMode::UnionIdentical,
|
||||
value => RepoCheckoutOverwriteMode::__Unknown(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)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "OstreeRepoCommitFilterResult")]
|
||||
pub enum RepoCommitFilterResult {
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_FILTER_ALLOW")]
|
||||
Allow,
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_FILTER_SKIP")]
|
||||
Skip,
|
||||
#[doc(hidden)]
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoCommitFilterResult {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoCommitFilterResult::{}", match *self {
|
||||
RepoCommitFilterResult::Allow => "Allow",
|
||||
RepoCommitFilterResult::Skip => "Skip",
|
||||
Self::Allow => "Allow",
|
||||
Self::Skip => "Skip",
|
||||
_ => "Unknown",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCommitFilterResult {
|
||||
type GlibType = ostree_sys::OstreeRepoCommitFilterResult;
|
||||
impl IntoGlib for RepoCommitFilterResult {
|
||||
type GlibType = ffi::OstreeRepoCommitFilterResult;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoCommitFilterResult {
|
||||
match *self {
|
||||
RepoCommitFilterResult::Allow => ostree_sys::OSTREE_REPO_COMMIT_FILTER_ALLOW,
|
||||
RepoCommitFilterResult::Skip => ostree_sys::OSTREE_REPO_COMMIT_FILTER_SKIP,
|
||||
RepoCommitFilterResult::__Unknown(value) => value
|
||||
}
|
||||
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<ostree_sys::OstreeRepoCommitFilterResult> for RepoCommitFilterResult {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoCommitFilterResult) -> Self {
|
||||
impl FromGlib<ffi::OstreeRepoCommitFilterResult> for RepoCommitFilterResult {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoCommitFilterResult) -> Self {
|
||||
match value {
|
||||
0 => RepoCommitFilterResult::Allow,
|
||||
1 => RepoCommitFilterResult::Skip,
|
||||
value => RepoCommitFilterResult::__Unknown(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)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "OstreeRepoCommitIterResult")]
|
||||
pub enum RepoCommitIterResult {
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_ITER_RESULT_ERROR")]
|
||||
Error,
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_ITER_RESULT_END")]
|
||||
End,
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_ITER_RESULT_FILE")]
|
||||
File,
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_ITER_RESULT_DIR")]
|
||||
Dir,
|
||||
#[doc(hidden)]
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoCommitIterResult {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoCommitIterResult::{}", match *self {
|
||||
RepoCommitIterResult::Error => "Error",
|
||||
RepoCommitIterResult::End => "End",
|
||||
RepoCommitIterResult::File => "File",
|
||||
RepoCommitIterResult::Dir => "Dir",
|
||||
Self::Error => "Error",
|
||||
Self::End => "End",
|
||||
Self::File => "File",
|
||||
Self::Dir => "Dir",
|
||||
_ => "Unknown",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCommitIterResult {
|
||||
type GlibType = ostree_sys::OstreeRepoCommitIterResult;
|
||||
impl IntoGlib for RepoCommitIterResult {
|
||||
type GlibType = ffi::OstreeRepoCommitIterResult;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoCommitIterResult {
|
||||
match *self {
|
||||
RepoCommitIterResult::Error => ostree_sys::OSTREE_REPO_COMMIT_ITER_RESULT_ERROR,
|
||||
RepoCommitIterResult::End => ostree_sys::OSTREE_REPO_COMMIT_ITER_RESULT_END,
|
||||
RepoCommitIterResult::File => ostree_sys::OSTREE_REPO_COMMIT_ITER_RESULT_FILE,
|
||||
RepoCommitIterResult::Dir => ostree_sys::OSTREE_REPO_COMMIT_ITER_RESULT_DIR,
|
||||
RepoCommitIterResult::__Unknown(value) => value
|
||||
}
|
||||
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<ostree_sys::OstreeRepoCommitIterResult> for RepoCommitIterResult {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoCommitIterResult) -> Self {
|
||||
impl FromGlib<ffi::OstreeRepoCommitIterResult> for RepoCommitIterResult {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoCommitIterResult) -> Self {
|
||||
match value {
|
||||
0 => RepoCommitIterResult::Error,
|
||||
1 => RepoCommitIterResult::End,
|
||||
2 => RepoCommitIterResult::File,
|
||||
3 => RepoCommitIterResult::Dir,
|
||||
value => RepoCommitIterResult::__Unknown(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)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "OstreeRepoMode")]
|
||||
pub enum RepoMode {
|
||||
#[doc(alias = "OSTREE_REPO_MODE_BARE")]
|
||||
Bare,
|
||||
#[doc(alias = "OSTREE_REPO_MODE_ARCHIVE")]
|
||||
Archive,
|
||||
#[doc(alias = "OSTREE_REPO_MODE_BARE_USER")]
|
||||
BareUser,
|
||||
#[doc(alias = "OSTREE_REPO_MODE_BARE_USER_ONLY")]
|
||||
BareUserOnly,
|
||||
#[doc(hidden)]
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoMode {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoMode::{}", match *self {
|
||||
RepoMode::Bare => "Bare",
|
||||
RepoMode::Archive => "Archive",
|
||||
RepoMode::BareUser => "BareUser",
|
||||
RepoMode::BareUserOnly => "BareUserOnly",
|
||||
Self::Bare => "Bare",
|
||||
Self::Archive => "Archive",
|
||||
Self::BareUser => "BareUser",
|
||||
Self::BareUserOnly => "BareUserOnly",
|
||||
_ => "Unknown",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoMode {
|
||||
type GlibType = ostree_sys::OstreeRepoMode;
|
||||
impl IntoGlib for RepoMode {
|
||||
type GlibType = ffi::OstreeRepoMode;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoMode {
|
||||
match *self {
|
||||
RepoMode::Bare => ostree_sys::OSTREE_REPO_MODE_BARE,
|
||||
RepoMode::Archive => ostree_sys::OSTREE_REPO_MODE_ARCHIVE,
|
||||
RepoMode::BareUser => ostree_sys::OSTREE_REPO_MODE_BARE_USER,
|
||||
RepoMode::BareUserOnly => ostree_sys::OSTREE_REPO_MODE_BARE_USER_ONLY,
|
||||
RepoMode::__Unknown(value) => value
|
||||
}
|
||||
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,
|
||||
Self::BareUserOnly => ffi::OSTREE_REPO_MODE_BARE_USER_ONLY,
|
||||
Self::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoMode> for RepoMode {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoMode) -> Self {
|
||||
impl FromGlib<ffi::OstreeRepoMode> for RepoMode {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoMode) -> Self {
|
||||
match value {
|
||||
0 => RepoMode::Bare,
|
||||
1 => RepoMode::Archive,
|
||||
2 => RepoMode::BareUser,
|
||||
3 => RepoMode::BareUserOnly,
|
||||
value => RepoMode::__Unknown(value),
|
||||
}
|
||||
ffi::OSTREE_REPO_MODE_BARE => Self::Bare,
|
||||
ffi::OSTREE_REPO_MODE_ARCHIVE => Self::Archive,
|
||||
ffi::OSTREE_REPO_MODE_BARE_USER => Self::BareUser,
|
||||
ffi::OSTREE_REPO_MODE_BARE_USER_ONLY => Self::BareUserOnly,
|
||||
value => Self::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "OstreeRepoRemoteChange")]
|
||||
pub enum RepoRemoteChange {
|
||||
#[doc(alias = "OSTREE_REPO_REMOTE_CHANGE_ADD")]
|
||||
Add,
|
||||
#[doc(alias = "OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS")]
|
||||
AddIfNotExists,
|
||||
#[doc(alias = "OSTREE_REPO_REMOTE_CHANGE_DELETE")]
|
||||
Delete,
|
||||
#[doc(alias = "OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS")]
|
||||
DeleteIfExists,
|
||||
#[doc(alias = "OSTREE_REPO_REMOTE_CHANGE_REPLACE")]
|
||||
Replace,
|
||||
#[doc(hidden)]
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoRemoteChange {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoRemoteChange::{}", match *self {
|
||||
RepoRemoteChange::Add => "Add",
|
||||
RepoRemoteChange::AddIfNotExists => "AddIfNotExists",
|
||||
RepoRemoteChange::Delete => "Delete",
|
||||
RepoRemoteChange::DeleteIfExists => "DeleteIfExists",
|
||||
RepoRemoteChange::Replace => "Replace",
|
||||
Self::Add => "Add",
|
||||
Self::AddIfNotExists => "AddIfNotExists",
|
||||
Self::Delete => "Delete",
|
||||
Self::DeleteIfExists => "DeleteIfExists",
|
||||
Self::Replace => "Replace",
|
||||
_ => "Unknown",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoRemoteChange {
|
||||
type GlibType = ostree_sys::OstreeRepoRemoteChange;
|
||||
impl IntoGlib for RepoRemoteChange {
|
||||
type GlibType = ffi::OstreeRepoRemoteChange;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoRemoteChange {
|
||||
match *self {
|
||||
RepoRemoteChange::Add => ostree_sys::OSTREE_REPO_REMOTE_CHANGE_ADD,
|
||||
RepoRemoteChange::AddIfNotExists => ostree_sys::OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS,
|
||||
RepoRemoteChange::Delete => ostree_sys::OSTREE_REPO_REMOTE_CHANGE_DELETE,
|
||||
RepoRemoteChange::DeleteIfExists => ostree_sys::OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS,
|
||||
RepoRemoteChange::Replace => ostree_sys::OSTREE_REPO_REMOTE_CHANGE_REPLACE,
|
||||
RepoRemoteChange::__Unknown(value) => value
|
||||
}
|
||||
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,
|
||||
Self::DeleteIfExists => ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS,
|
||||
Self::Replace => ffi::OSTREE_REPO_REMOTE_CHANGE_REPLACE,
|
||||
Self::__Unknown(value) => value,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoRemoteChange> for RepoRemoteChange {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoRemoteChange) -> Self {
|
||||
impl FromGlib<ffi::OstreeRepoRemoteChange> for RepoRemoteChange {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoRemoteChange) -> Self {
|
||||
match value {
|
||||
0 => RepoRemoteChange::Add,
|
||||
1 => RepoRemoteChange::AddIfNotExists,
|
||||
2 => RepoRemoteChange::Delete,
|
||||
3 => RepoRemoteChange::DeleteIfExists,
|
||||
4 => RepoRemoteChange::Replace,
|
||||
value => RepoRemoteChange::__Unknown(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,
|
||||
ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS => Self::DeleteIfExists,
|
||||
ffi::OSTREE_REPO_REMOTE_CHANGE_REPLACE => Self::Replace,
|
||||
value => Self::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
#[non_exhaustive]
|
||||
#[doc(alias = "OstreeStaticDeltaGenerateOpt")]
|
||||
pub enum StaticDeltaGenerateOpt {
|
||||
#[doc(alias = "OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY")]
|
||||
Lowlatency,
|
||||
#[doc(alias = "OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR")]
|
||||
Major,
|
||||
#[doc(hidden)]
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
impl fmt::Display for StaticDeltaGenerateOpt {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "StaticDeltaGenerateOpt::{}", match *self {
|
||||
StaticDeltaGenerateOpt::Lowlatency => "Lowlatency",
|
||||
StaticDeltaGenerateOpt::Major => "Major",
|
||||
Self::Lowlatency => "Lowlatency",
|
||||
Self::Major => "Major",
|
||||
_ => "Unknown",
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for StaticDeltaGenerateOpt {
|
||||
type GlibType = ostree_sys::OstreeStaticDeltaGenerateOpt;
|
||||
impl IntoGlib for StaticDeltaGenerateOpt {
|
||||
type GlibType = ffi::OstreeStaticDeltaGenerateOpt;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeStaticDeltaGenerateOpt {
|
||||
match *self {
|
||||
StaticDeltaGenerateOpt::Lowlatency => ostree_sys::OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY,
|
||||
StaticDeltaGenerateOpt::Major => ostree_sys::OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR,
|
||||
StaticDeltaGenerateOpt::__Unknown(value) => value
|
||||
}
|
||||
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<ostree_sys::OstreeStaticDeltaGenerateOpt> for StaticDeltaGenerateOpt {
|
||||
fn from_glib(value: ostree_sys::OstreeStaticDeltaGenerateOpt) -> Self {
|
||||
impl FromGlib<ffi::OstreeStaticDeltaGenerateOpt> for StaticDeltaGenerateOpt {
|
||||
unsafe fn from_glib(value: ffi::OstreeStaticDeltaGenerateOpt) -> Self {
|
||||
match value {
|
||||
0 => StaticDeltaGenerateOpt::Lowlatency,
|
||||
1 => StaticDeltaGenerateOpt::Major,
|
||||
value => StaticDeltaGenerateOpt::__Unknown(value),
|
||||
}
|
||||
ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY => Self::Lowlatency,
|
||||
ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR => Self::Major,
|
||||
value => Self::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
483
rust-bindings/rust/src/auto/flags.rs
generated
483
rust-bindings/rust/src/auto/flags.rs
generated
@ -1,407 +1,576 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use bitflags::bitflags;
|
||||
use glib::translate::*;
|
||||
use glib::value::FromValue;
|
||||
use glib::value::FromValueOptional;
|
||||
use glib::value::SetValue;
|
||||
use glib::value::Value;
|
||||
use glib::value::ToValue;
|
||||
use glib::StaticType;
|
||||
use glib::Type;
|
||||
use gobject_sys;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
|
||||
#[cfg(any(feature = "v2017_13", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeChecksumFlags")]
|
||||
pub struct ChecksumFlags: u32 {
|
||||
const NONE = 0;
|
||||
const IGNORE_XATTRS = 1;
|
||||
#[doc(alias = "OSTREE_CHECKSUM_FLAGS_NONE")]
|
||||
const NONE = ffi::OSTREE_CHECKSUM_FLAGS_NONE as u32;
|
||||
#[doc(alias = "OSTREE_CHECKSUM_FLAGS_IGNORE_XATTRS")]
|
||||
const IGNORE_XATTRS = ffi::OSTREE_CHECKSUM_FLAGS_IGNORE_XATTRS as u32;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2017_13", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for ChecksumFlags {
|
||||
type GlibType = ostree_sys::OstreeChecksumFlags;
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
|
||||
impl fmt::Display for ChecksumFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeChecksumFlags {
|
||||
#[cfg(any(feature = "v2017_13", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
|
||||
#[doc(hidden)]
|
||||
impl IntoGlib for ChecksumFlags {
|
||||
type GlibType = ffi::OstreeChecksumFlags;
|
||||
|
||||
fn into_glib(self) -> ffi::OstreeChecksumFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2017_13", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeChecksumFlags> for ChecksumFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeChecksumFlags) -> ChecksumFlags {
|
||||
ChecksumFlags::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeChecksumFlags> for ChecksumFlags {
|
||||
unsafe fn from_glib(value: ffi::OstreeChecksumFlags) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeDiffFlags")]
|
||||
pub struct DiffFlags: u32 {
|
||||
const NONE = 0;
|
||||
const IGNORE_XATTRS = 1;
|
||||
#[doc(alias = "OSTREE_DIFF_FLAGS_NONE")]
|
||||
const NONE = ffi::OSTREE_DIFF_FLAGS_NONE as u32;
|
||||
#[doc(alias = "OSTREE_DIFF_FLAGS_IGNORE_XATTRS")]
|
||||
const IGNORE_XATTRS = ffi::OSTREE_DIFF_FLAGS_IGNORE_XATTRS as u32;
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for DiffFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for DiffFlags {
|
||||
type GlibType = ostree_sys::OstreeDiffFlags;
|
||||
impl IntoGlib for DiffFlags {
|
||||
type GlibType = ffi::OstreeDiffFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeDiffFlags {
|
||||
fn into_glib(self) -> ffi::OstreeDiffFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeDiffFlags> for DiffFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeDiffFlags) -> DiffFlags {
|
||||
DiffFlags::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeDiffFlags> for DiffFlags {
|
||||
unsafe fn from_glib(value: ffi::OstreeDiffFlags) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeGpgSignatureFormatFlags")]
|
||||
pub struct GpgSignatureFormatFlags: u32 {
|
||||
const GPG_SIGNATURE_FORMAT_DEFAULT = 0;
|
||||
#[doc(alias = "OSTREE_GPG_SIGNATURE_FORMAT_DEFAULT")]
|
||||
const GPG_SIGNATURE_FORMAT_DEFAULT = ffi::OSTREE_GPG_SIGNATURE_FORMAT_DEFAULT as u32;
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for GpgSignatureFormatFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for GpgSignatureFormatFlags {
|
||||
type GlibType = ostree_sys::OstreeGpgSignatureFormatFlags;
|
||||
impl IntoGlib for GpgSignatureFormatFlags {
|
||||
type GlibType = ffi::OstreeGpgSignatureFormatFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeGpgSignatureFormatFlags {
|
||||
fn into_glib(self) -> ffi::OstreeGpgSignatureFormatFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeGpgSignatureFormatFlags> for GpgSignatureFormatFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeGpgSignatureFormatFlags) -> GpgSignatureFormatFlags {
|
||||
GpgSignatureFormatFlags::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeGpgSignatureFormatFlags> for GpgSignatureFormatFlags {
|
||||
unsafe fn from_glib(value: ffi::OstreeGpgSignatureFormatFlags) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeRepoCommitModifierFlags")]
|
||||
pub struct RepoCommitModifierFlags: u32 {
|
||||
const NONE = 0;
|
||||
const SKIP_XATTRS = 1;
|
||||
const GENERATE_SIZES = 2;
|
||||
const CANONICAL_PERMISSIONS = 4;
|
||||
const ERROR_ON_UNLABELED = 8;
|
||||
const CONSUME = 16;
|
||||
const DEVINO_CANONICAL = 32;
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_MODIFIER_FLAGS_NONE")]
|
||||
const NONE = ffi::OSTREE_REPO_COMMIT_MODIFIER_FLAGS_NONE as u32;
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SKIP_XATTRS")]
|
||||
const SKIP_XATTRS = ffi::OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SKIP_XATTRS as u32;
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES")]
|
||||
const GENERATE_SIZES = ffi::OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES as u32;
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CANONICAL_PERMISSIONS")]
|
||||
const CANONICAL_PERMISSIONS = ffi::OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CANONICAL_PERMISSIONS as u32;
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_MODIFIER_FLAGS_ERROR_ON_UNLABELED")]
|
||||
const ERROR_ON_UNLABELED = ffi::OSTREE_REPO_COMMIT_MODIFIER_FLAGS_ERROR_ON_UNLABELED as u32;
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CONSUME")]
|
||||
const CONSUME = ffi::OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CONSUME as u32;
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_MODIFIER_FLAGS_DEVINO_CANONICAL")]
|
||||
const DEVINO_CANONICAL = ffi::OSTREE_REPO_COMMIT_MODIFIER_FLAGS_DEVINO_CANONICAL as u32;
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoCommitModifierFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCommitModifierFlags {
|
||||
type GlibType = ostree_sys::OstreeRepoCommitModifierFlags;
|
||||
impl IntoGlib for RepoCommitModifierFlags {
|
||||
type GlibType = ffi::OstreeRepoCommitModifierFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoCommitModifierFlags {
|
||||
fn into_glib(self) -> ffi::OstreeRepoCommitModifierFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoCommitModifierFlags> for RepoCommitModifierFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoCommitModifierFlags) -> RepoCommitModifierFlags {
|
||||
RepoCommitModifierFlags::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeRepoCommitModifierFlags> for RepoCommitModifierFlags {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoCommitModifierFlags) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))]
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeRepoCommitState")]
|
||||
pub struct RepoCommitState: u32 {
|
||||
const NORMAL = 0;
|
||||
const PARTIAL = 1;
|
||||
const FSCK_PARTIAL = 2;
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_STATE_NORMAL")]
|
||||
const NORMAL = ffi::OSTREE_REPO_COMMIT_STATE_NORMAL as u32;
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_STATE_PARTIAL")]
|
||||
const PARTIAL = ffi::OSTREE_REPO_COMMIT_STATE_PARTIAL as u32;
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_STATE_FSCK_PARTIAL")]
|
||||
const FSCK_PARTIAL = ffi::OSTREE_REPO_COMMIT_STATE_FSCK_PARTIAL as u32;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCommitState {
|
||||
type GlibType = ostree_sys::OstreeRepoCommitState;
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))]
|
||||
impl fmt::Display for RepoCommitState {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoCommitState {
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))]
|
||||
#[doc(hidden)]
|
||||
impl IntoGlib for RepoCommitState {
|
||||
type GlibType = ffi::OstreeRepoCommitState;
|
||||
|
||||
fn into_glib(self) -> ffi::OstreeRepoCommitState {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2015_7")))]
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoCommitState> for RepoCommitState {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoCommitState) -> RepoCommitState {
|
||||
RepoCommitState::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeRepoCommitState> for RepoCommitState {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoCommitState) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeRepoCommitTraverseFlags")]
|
||||
pub struct RepoCommitTraverseFlags: u32 {
|
||||
const REPO_COMMIT_TRAVERSE_FLAG_NONE = 1;
|
||||
#[doc(alias = "OSTREE_REPO_COMMIT_TRAVERSE_FLAG_NONE")]
|
||||
const REPO_COMMIT_TRAVERSE_FLAG_NONE = ffi::OSTREE_REPO_COMMIT_TRAVERSE_FLAG_NONE as u32;
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoCommitTraverseFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCommitTraverseFlags {
|
||||
type GlibType = ostree_sys::OstreeRepoCommitTraverseFlags;
|
||||
impl IntoGlib for RepoCommitTraverseFlags {
|
||||
type GlibType = ffi::OstreeRepoCommitTraverseFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoCommitTraverseFlags {
|
||||
fn into_glib(self) -> ffi::OstreeRepoCommitTraverseFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoCommitTraverseFlags> for RepoCommitTraverseFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoCommitTraverseFlags) -> RepoCommitTraverseFlags {
|
||||
RepoCommitTraverseFlags::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeRepoCommitTraverseFlags> for RepoCommitTraverseFlags {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoCommitTraverseFlags) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeRepoListObjectsFlags")]
|
||||
pub struct RepoListObjectsFlags: u32 {
|
||||
const LOOSE = 1;
|
||||
const PACKED = 2;
|
||||
const ALL = 4;
|
||||
const NO_PARENTS = 8;
|
||||
#[doc(alias = "OSTREE_REPO_LIST_OBJECTS_LOOSE")]
|
||||
const LOOSE = ffi::OSTREE_REPO_LIST_OBJECTS_LOOSE as u32;
|
||||
#[doc(alias = "OSTREE_REPO_LIST_OBJECTS_PACKED")]
|
||||
const PACKED = ffi::OSTREE_REPO_LIST_OBJECTS_PACKED as u32;
|
||||
#[doc(alias = "OSTREE_REPO_LIST_OBJECTS_ALL")]
|
||||
const ALL = ffi::OSTREE_REPO_LIST_OBJECTS_ALL as u32;
|
||||
#[doc(alias = "OSTREE_REPO_LIST_OBJECTS_NO_PARENTS")]
|
||||
const NO_PARENTS = ffi::OSTREE_REPO_LIST_OBJECTS_NO_PARENTS as u32;
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoListObjectsFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoListObjectsFlags {
|
||||
type GlibType = ostree_sys::OstreeRepoListObjectsFlags;
|
||||
impl IntoGlib for RepoListObjectsFlags {
|
||||
type GlibType = ffi::OstreeRepoListObjectsFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoListObjectsFlags {
|
||||
fn into_glib(self) -> ffi::OstreeRepoListObjectsFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoListObjectsFlags> for RepoListObjectsFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoListObjectsFlags) -> RepoListObjectsFlags {
|
||||
RepoListObjectsFlags::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeRepoListObjectsFlags> for RepoListObjectsFlags {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoListObjectsFlags) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeRepoListRefsExtFlags")]
|
||||
pub struct RepoListRefsExtFlags: u32 {
|
||||
const NONE = 0;
|
||||
const ALIASES = 1;
|
||||
const EXCLUDE_REMOTES = 2;
|
||||
const EXCLUDE_MIRRORS = 4;
|
||||
#[doc(alias = "OSTREE_REPO_LIST_REFS_EXT_NONE")]
|
||||
const NONE = ffi::OSTREE_REPO_LIST_REFS_EXT_NONE as u32;
|
||||
#[doc(alias = "OSTREE_REPO_LIST_REFS_EXT_ALIASES")]
|
||||
const ALIASES = ffi::OSTREE_REPO_LIST_REFS_EXT_ALIASES as u32;
|
||||
#[doc(alias = "OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES")]
|
||||
const EXCLUDE_REMOTES = ffi::OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES as u32;
|
||||
#[doc(alias = "OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_MIRRORS")]
|
||||
const EXCLUDE_MIRRORS = ffi::OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_MIRRORS as u32;
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoListRefsExtFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoListRefsExtFlags {
|
||||
type GlibType = ostree_sys::OstreeRepoListRefsExtFlags;
|
||||
impl IntoGlib for RepoListRefsExtFlags {
|
||||
type GlibType = ffi::OstreeRepoListRefsExtFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoListRefsExtFlags {
|
||||
fn into_glib(self) -> ffi::OstreeRepoListRefsExtFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoListRefsExtFlags> for RepoListRefsExtFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoListRefsExtFlags) -> RepoListRefsExtFlags {
|
||||
RepoListRefsExtFlags::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeRepoListRefsExtFlags> for RepoListRefsExtFlags {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoListRefsExtFlags) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeRepoPruneFlags")]
|
||||
pub struct RepoPruneFlags: u32 {
|
||||
const NONE = 0;
|
||||
const NO_PRUNE = 1;
|
||||
const REFS_ONLY = 2;
|
||||
#[doc(alias = "OSTREE_REPO_PRUNE_FLAGS_NONE")]
|
||||
const NONE = ffi::OSTREE_REPO_PRUNE_FLAGS_NONE as u32;
|
||||
#[doc(alias = "OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE")]
|
||||
const NO_PRUNE = ffi::OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE as u32;
|
||||
#[doc(alias = "OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY")]
|
||||
const REFS_ONLY = ffi::OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY as u32;
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoPruneFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoPruneFlags {
|
||||
type GlibType = ostree_sys::OstreeRepoPruneFlags;
|
||||
impl IntoGlib for RepoPruneFlags {
|
||||
type GlibType = ffi::OstreeRepoPruneFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoPruneFlags {
|
||||
fn into_glib(self) -> ffi::OstreeRepoPruneFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoPruneFlags> for RepoPruneFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoPruneFlags) -> RepoPruneFlags {
|
||||
RepoPruneFlags::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeRepoPruneFlags> for RepoPruneFlags {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoPruneFlags) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeRepoPullFlags")]
|
||||
pub struct RepoPullFlags: u32 {
|
||||
const NONE = 0;
|
||||
const MIRROR = 1;
|
||||
const COMMIT_ONLY = 2;
|
||||
const UNTRUSTED = 4;
|
||||
const BAREUSERONLY_FILES = 8;
|
||||
const TRUSTED_HTTP = 16;
|
||||
#[doc(alias = "OSTREE_REPO_PULL_FLAGS_NONE")]
|
||||
const NONE = ffi::OSTREE_REPO_PULL_FLAGS_NONE as u32;
|
||||
#[doc(alias = "OSTREE_REPO_PULL_FLAGS_MIRROR")]
|
||||
const MIRROR = ffi::OSTREE_REPO_PULL_FLAGS_MIRROR as u32;
|
||||
#[doc(alias = "OSTREE_REPO_PULL_FLAGS_COMMIT_ONLY")]
|
||||
const COMMIT_ONLY = ffi::OSTREE_REPO_PULL_FLAGS_COMMIT_ONLY as u32;
|
||||
#[doc(alias = "OSTREE_REPO_PULL_FLAGS_UNTRUSTED")]
|
||||
const UNTRUSTED = ffi::OSTREE_REPO_PULL_FLAGS_UNTRUSTED as u32;
|
||||
#[doc(alias = "OSTREE_REPO_PULL_FLAGS_BAREUSERONLY_FILES")]
|
||||
const BAREUSERONLY_FILES = ffi::OSTREE_REPO_PULL_FLAGS_BAREUSERONLY_FILES as u32;
|
||||
#[doc(alias = "OSTREE_REPO_PULL_FLAGS_TRUSTED_HTTP")]
|
||||
const TRUSTED_HTTP = ffi::OSTREE_REPO_PULL_FLAGS_TRUSTED_HTTP as u32;
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoPullFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoPullFlags {
|
||||
type GlibType = ostree_sys::OstreeRepoPullFlags;
|
||||
impl IntoGlib for RepoPullFlags {
|
||||
type GlibType = ffi::OstreeRepoPullFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoPullFlags {
|
||||
fn into_glib(self) -> ffi::OstreeRepoPullFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoPullFlags> for RepoPullFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoPullFlags) -> RepoPullFlags {
|
||||
RepoPullFlags::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeRepoPullFlags> for RepoPullFlags {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoPullFlags) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeRepoResolveRevExtFlags")]
|
||||
pub struct RepoResolveRevExtFlags: u32 {
|
||||
const NONE = 0;
|
||||
const LOCAL_ONLY = 1;
|
||||
#[doc(alias = "OSTREE_REPO_RESOLVE_REV_EXT_NONE")]
|
||||
const NONE = ffi::OSTREE_REPO_RESOLVE_REV_EXT_NONE as u32;
|
||||
#[doc(alias = "OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY")]
|
||||
const LOCAL_ONLY = ffi::OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY as u32;
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoResolveRevExtFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoResolveRevExtFlags {
|
||||
type GlibType = ostree_sys::OstreeRepoResolveRevExtFlags;
|
||||
impl IntoGlib for RepoResolveRevExtFlags {
|
||||
type GlibType = ffi::OstreeRepoResolveRevExtFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeRepoResolveRevExtFlags {
|
||||
fn into_glib(self) -> ffi::OstreeRepoResolveRevExtFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeRepoResolveRevExtFlags> for RepoResolveRevExtFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeRepoResolveRevExtFlags) -> RepoResolveRevExtFlags {
|
||||
RepoResolveRevExtFlags::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeRepoResolveRevExtFlags> for RepoResolveRevExtFlags {
|
||||
unsafe fn from_glib(value: ffi::OstreeRepoResolveRevExtFlags) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeSePolicyRestoreconFlags")]
|
||||
pub struct SePolicyRestoreconFlags: u32 {
|
||||
const NONE = 0;
|
||||
const ALLOW_NOLABEL = 1;
|
||||
const KEEP_EXISTING = 2;
|
||||
#[doc(alias = "OSTREE_SEPOLICY_RESTORECON_FLAGS_NONE")]
|
||||
const NONE = ffi::OSTREE_SEPOLICY_RESTORECON_FLAGS_NONE as u32;
|
||||
#[doc(alias = "OSTREE_SEPOLICY_RESTORECON_FLAGS_ALLOW_NOLABEL")]
|
||||
const ALLOW_NOLABEL = ffi::OSTREE_SEPOLICY_RESTORECON_FLAGS_ALLOW_NOLABEL as u32;
|
||||
#[doc(alias = "OSTREE_SEPOLICY_RESTORECON_FLAGS_KEEP_EXISTING")]
|
||||
const KEEP_EXISTING = ffi::OSTREE_SEPOLICY_RESTORECON_FLAGS_KEEP_EXISTING as u32;
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for SePolicyRestoreconFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for SePolicyRestoreconFlags {
|
||||
type GlibType = ostree_sys::OstreeSePolicyRestoreconFlags;
|
||||
impl IntoGlib for SePolicyRestoreconFlags {
|
||||
type GlibType = ffi::OstreeSePolicyRestoreconFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeSePolicyRestoreconFlags {
|
||||
fn into_glib(self) -> ffi::OstreeSePolicyRestoreconFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeSePolicyRestoreconFlags> for SePolicyRestoreconFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeSePolicyRestoreconFlags) -> SePolicyRestoreconFlags {
|
||||
SePolicyRestoreconFlags::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeSePolicyRestoreconFlags> for SePolicyRestoreconFlags {
|
||||
unsafe fn from_glib(value: ffi::OstreeSePolicyRestoreconFlags) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeSysrootSimpleWriteDeploymentFlags")]
|
||||
pub struct SysrootSimpleWriteDeploymentFlags: u32 {
|
||||
const NONE = 0;
|
||||
const RETAIN = 1;
|
||||
const NOT_DEFAULT = 2;
|
||||
const NO_CLEAN = 4;
|
||||
const RETAIN_PENDING = 8;
|
||||
const RETAIN_ROLLBACK = 16;
|
||||
#[doc(alias = "OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NONE")]
|
||||
const NONE = ffi::OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NONE as u32;
|
||||
#[doc(alias = "OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN")]
|
||||
const RETAIN = ffi::OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN as u32;
|
||||
#[doc(alias = "OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NOT_DEFAULT")]
|
||||
const NOT_DEFAULT = ffi::OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NOT_DEFAULT as u32;
|
||||
#[doc(alias = "OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NO_CLEAN")]
|
||||
const NO_CLEAN = ffi::OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NO_CLEAN as u32;
|
||||
#[doc(alias = "OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_PENDING")]
|
||||
const RETAIN_PENDING = ffi::OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_PENDING as u32;
|
||||
#[doc(alias = "OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_ROLLBACK")]
|
||||
const RETAIN_ROLLBACK = ffi::OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_ROLLBACK as u32;
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for SysrootSimpleWriteDeploymentFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for SysrootSimpleWriteDeploymentFlags {
|
||||
type GlibType = ostree_sys::OstreeSysrootSimpleWriteDeploymentFlags;
|
||||
impl IntoGlib for SysrootSimpleWriteDeploymentFlags {
|
||||
type GlibType = ffi::OstreeSysrootSimpleWriteDeploymentFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeSysrootSimpleWriteDeploymentFlags {
|
||||
fn into_glib(self) -> ffi::OstreeSysrootSimpleWriteDeploymentFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeSysrootSimpleWriteDeploymentFlags> for SysrootSimpleWriteDeploymentFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeSysrootSimpleWriteDeploymentFlags) -> SysrootSimpleWriteDeploymentFlags {
|
||||
SysrootSimpleWriteDeploymentFlags::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeSysrootSimpleWriteDeploymentFlags> for SysrootSimpleWriteDeploymentFlags {
|
||||
unsafe fn from_glib(value: ffi::OstreeSysrootSimpleWriteDeploymentFlags) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeSysrootUpgraderFlags")]
|
||||
pub struct SysrootUpgraderFlags: u32 {
|
||||
const IGNORE_UNCONFIGURED = 2;
|
||||
#[doc(alias = "OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED")]
|
||||
const IGNORE_UNCONFIGURED = ffi::OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED as u32;
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for SysrootUpgraderFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for SysrootUpgraderFlags {
|
||||
type GlibType = ostree_sys::OstreeSysrootUpgraderFlags;
|
||||
impl IntoGlib for SysrootUpgraderFlags {
|
||||
type GlibType = ffi::OstreeSysrootUpgraderFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeSysrootUpgraderFlags {
|
||||
fn into_glib(self) -> ffi::OstreeSysrootUpgraderFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeSysrootUpgraderFlags> for SysrootUpgraderFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeSysrootUpgraderFlags) -> SysrootUpgraderFlags {
|
||||
SysrootUpgraderFlags::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeSysrootUpgraderFlags> for SysrootUpgraderFlags {
|
||||
unsafe fn from_glib(value: ffi::OstreeSysrootUpgraderFlags) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl StaticType for SysrootUpgraderFlags {
|
||||
fn static_type() -> Type {
|
||||
unsafe { from_glib(ostree_sys::ostree_sysroot_upgrader_flags_get_type()) }
|
||||
unsafe { from_glib(ffi::ostree_sysroot_upgrader_flags_get_type()) }
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValueOptional<'a> for SysrootUpgraderFlags {
|
||||
unsafe fn from_value_optional(value: &Value) -> Option<Self> {
|
||||
Some(FromValue::from_value(value))
|
||||
impl glib::value::ValueType for SysrootUpgraderFlags {
|
||||
type Type = Self;
|
||||
}
|
||||
|
||||
unsafe impl<'a> FromValue<'a> for SysrootUpgraderFlags {
|
||||
type Checker = glib::value::GenericValueTypeChecker<Self>;
|
||||
|
||||
unsafe fn from_value(value: &'a glib::Value) -> Self {
|
||||
from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> FromValue<'a> for SysrootUpgraderFlags {
|
||||
unsafe fn from_value(value: &Value) -> Self {
|
||||
from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
|
||||
impl ToValue for SysrootUpgraderFlags {
|
||||
fn to_value(&self) -> glib::Value {
|
||||
let mut value = glib::Value::for_value_type::<Self>();
|
||||
unsafe {
|
||||
glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
|
||||
}
|
||||
value
|
||||
}
|
||||
}
|
||||
|
||||
impl SetValue for SysrootUpgraderFlags {
|
||||
unsafe fn set_value(value: &mut Value, this: &Self) {
|
||||
gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
|
||||
fn value_type(&self) -> glib::Type {
|
||||
Self::static_type()
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
#[doc(alias = "OstreeSysrootUpgraderPullFlags")]
|
||||
pub struct SysrootUpgraderPullFlags: u32 {
|
||||
const NONE = 0;
|
||||
const ALLOW_OLDER = 1;
|
||||
const SYNTHETIC = 2;
|
||||
#[doc(alias = "OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_NONE")]
|
||||
const NONE = ffi::OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_NONE as u32;
|
||||
#[doc(alias = "OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_ALLOW_OLDER")]
|
||||
const ALLOW_OLDER = ffi::OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_ALLOW_OLDER as u32;
|
||||
#[doc(alias = "OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_SYNTHETIC")]
|
||||
const SYNTHETIC = ffi::OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_SYNTHETIC as u32;
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for SysrootUpgraderPullFlags {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
<Self as fmt::Debug>::fmt(self, f)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for SysrootUpgraderPullFlags {
|
||||
type GlibType = ostree_sys::OstreeSysrootUpgraderPullFlags;
|
||||
impl IntoGlib for SysrootUpgraderPullFlags {
|
||||
type GlibType = ffi::OstreeSysrootUpgraderPullFlags;
|
||||
|
||||
fn to_glib(&self) -> ostree_sys::OstreeSysrootUpgraderPullFlags {
|
||||
fn into_glib(self) -> ffi::OstreeSysrootUpgraderPullFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ostree_sys::OstreeSysrootUpgraderPullFlags> for SysrootUpgraderPullFlags {
|
||||
fn from_glib(value: ostree_sys::OstreeSysrootUpgraderPullFlags) -> SysrootUpgraderPullFlags {
|
||||
SysrootUpgraderPullFlags::from_bits_truncate(value)
|
||||
impl FromGlib<ffi::OstreeSysrootUpgraderPullFlags> for SysrootUpgraderPullFlags {
|
||||
unsafe fn from_glib(value: ffi::OstreeSysrootUpgraderPullFlags) -> Self {
|
||||
Self::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
|
168
rust-bindings/rust/src/auto/functions.rs
generated
168
rust-bindings/rust/src/auto/functions.rs
generated
@ -1,335 +1,385 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use gio;
|
||||
use glib;
|
||||
#[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 glib::GString;
|
||||
use ostree_sys;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
#[cfg(any(feature = "v2020_1", feature = "dox"))]
|
||||
use CommitSizesEntry;
|
||||
use DiffFlags;
|
||||
use DiffItem;
|
||||
use ObjectType;
|
||||
|
||||
|
||||
#[cfg(any(feature = "v2017_15", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_15")))]
|
||||
#[doc(alias = "ostree_break_hardlink")]
|
||||
pub fn break_hardlink<P: IsA<gio::Cancellable>>(dfd: i32, path: &str, skip_xattrs: bool, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_break_hardlink(dfd, path.to_glib_none().0, skip_xattrs.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_check_version")]
|
||||
pub fn check_version(required_year: u32, required_release: u32) -> bool {
|
||||
unsafe {
|
||||
from_glib(ostree_sys::ostree_check_version(required_year, required_release))
|
||||
from_glib(ffi::ostree_check_version(required_year, required_release))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "ostree_checksum_bytes_peek")]
|
||||
//pub fn checksum_bytes_peek(bytes: &glib::Variant) -> /*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32 {
|
||||
// unsafe { TODO: call ostree_sys:ostree_checksum_bytes_peek() }
|
||||
// unsafe { TODO: call ffi:ostree_checksum_bytes_peek() }
|
||||
//}
|
||||
|
||||
//#[doc(alias = "ostree_checksum_bytes_peek_validate")]
|
||||
//pub fn checksum_bytes_peek_validate(bytes: &glib::Variant) -> Result</*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, glib::Error> {
|
||||
// unsafe { TODO: call ostree_sys:ostree_checksum_bytes_peek_validate() }
|
||||
// unsafe { TODO: call ffi:ostree_checksum_bytes_peek_validate() }
|
||||
//}
|
||||
|
||||
pub fn checksum_from_bytes_v(csum_v: &glib::Variant) -> Option<GString> {
|
||||
#[doc(alias = "ostree_checksum_from_bytes_v")]
|
||||
pub fn checksum_from_bytes_v(csum_v: &glib::Variant) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_checksum_from_bytes_v(csum_v.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_checksum_from_bytes_v(csum_v.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_checksum_to_bytes_v")]
|
||||
pub fn checksum_to_bytes_v(checksum: &str) -> Option<glib::Variant> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_checksum_to_bytes_v(checksum.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_checksum_to_bytes_v(checksum.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_2", feature = "dox"))]
|
||||
pub fn commit_get_content_checksum(commit_variant: &glib::Variant) -> Option<GString> {
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))]
|
||||
#[doc(alias = "ostree_commit_get_content_checksum")]
|
||||
pub fn commit_get_content_checksum(commit_variant: &glib::Variant) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_commit_get_content_checksum(commit_variant.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_commit_get_content_checksum(commit_variant.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_1", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))]
|
||||
#[doc(alias = "ostree_commit_get_object_sizes")]
|
||||
pub fn commit_get_object_sizes(commit_variant: &glib::Variant) -> Result<Vec<CommitSizesEntry>, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_sizes_entries = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_commit_get_object_sizes(commit_variant.to_glib_none().0, &mut out_sizes_entries, &mut error);
|
||||
let _ = ffi::ostree_commit_get_object_sizes(commit_variant.to_glib_none().0, &mut out_sizes_entries, &mut error);
|
||||
if error.is_null() { Ok(FromGlibPtrContainer::from_glib_container(out_sizes_entries)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn commit_get_parent(commit_variant: &glib::Variant) -> Option<GString> {
|
||||
#[doc(alias = "ostree_commit_get_parent")]
|
||||
pub fn commit_get_parent(commit_variant: &glib::Variant) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_commit_get_parent(commit_variant.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_commit_get_parent(commit_variant.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2016_3", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_3")))]
|
||||
#[doc(alias = "ostree_commit_get_timestamp")]
|
||||
pub fn commit_get_timestamp(commit_variant: &glib::Variant) -> u64 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_commit_get_timestamp(commit_variant.to_glib_none().0)
|
||||
ffi::ostree_commit_get_timestamp(commit_variant.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
//#[cfg(any(feature = "v2021_1", feature = "dox"))]
|
||||
//#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))]
|
||||
//#[doc(alias = "ostree_commit_metadata_for_bootable")]
|
||||
//pub fn commit_metadata_for_bootable<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(root: &P, dict: /*Ignored*/&glib::VariantDict, cancellable: Option<&Q>) -> Result<(), glib::Error> {
|
||||
// unsafe { TODO: call ostree_sys:ostree_commit_metadata_for_bootable() }
|
||||
// unsafe { TODO: call ffi:ostree_commit_metadata_for_bootable() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "ostree_content_file_parse")]
|
||||
pub fn content_file_parse<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(compressed: bool, content_path: &P, trusted: bool, cancellable: Option<&Q>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), glib::Error> {
|
||||
unsafe {
|
||||
let mut out_input = ptr::null_mut();
|
||||
let mut out_file_info = ptr::null_mut();
|
||||
let mut out_xattrs = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_content_file_parse(compressed.to_glib(), content_path.as_ref().to_glib_none().0, trusted.to_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
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)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_content_file_parse_at")]
|
||||
pub fn content_file_parse_at<P: IsA<gio::Cancellable>>(compressed: bool, parent_dfd: i32, path: &str, trusted: bool, cancellable: Option<&P>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), glib::Error> {
|
||||
unsafe {
|
||||
let mut out_input = ptr::null_mut();
|
||||
let mut out_file_info = ptr::null_mut();
|
||||
let mut out_xattrs = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_content_file_parse_at(compressed.to_glib(), parent_dfd, path.to_glib_none().0, trusted.to_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
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)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_content_stream_parse")]
|
||||
pub fn content_stream_parse<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(compressed: bool, input: &P, input_length: u64, trusted: bool, cancellable: Option<&Q>) -> Result<(gio::InputStream, gio::FileInfo, glib::Variant), glib::Error> {
|
||||
unsafe {
|
||||
let mut out_input = ptr::null_mut();
|
||||
let mut out_file_info = ptr::null_mut();
|
||||
let mut out_xattrs = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_content_stream_parse(compressed.to_glib(), input.as_ref().to_glib_none().0, input_length, trusted.to_glib(), &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
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)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_create_directory_metadata")]
|
||||
pub fn create_directory_metadata(dir_info: &gio::FileInfo, xattrs: Option<&glib::Variant>) -> Option<glib::Variant> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_create_directory_metadata(dir_info.to_glib_none().0, xattrs.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_create_directory_metadata(dir_info.to_glib_none().0, xattrs.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_diff_dirs")]
|
||||
pub fn diff_dirs<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(flags: DiffFlags, a: &P, b: &Q, modified: &[&DiffItem], removed: &[gio::File], added: &[gio::File], cancellable: Option<&R>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_diff_dirs(flags.to_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);
|
||||
let _ = 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);
|
||||
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")))]
|
||||
//#[doc(alias = "ostree_diff_dirs_with_options")]
|
||||
//pub fn diff_dirs_with_options<P: IsA<gio::File>, Q: IsA<gio::File>, R: IsA<gio::Cancellable>>(flags: DiffFlags, a: &P, b: &Q, modified: &[&DiffItem], removed: &[gio::File], added: &[gio::File], options: /*Ignored*/Option<&mut DiffDirsOptions>, cancellable: Option<&R>) -> Result<(), glib::Error> {
|
||||
// unsafe { TODO: call ostree_sys:ostree_diff_dirs_with_options() }
|
||||
// unsafe { TODO: call ffi:ostree_diff_dirs_with_options() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "ostree_diff_print")]
|
||||
pub fn diff_print<P: IsA<gio::File>, Q: IsA<gio::File>>(a: &P, b: &Q, modified: &[&DiffItem], removed: &[gio::File], added: &[gio::File]) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_diff_print(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);
|
||||
ffi::ostree_diff_print(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);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2017_10", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))]
|
||||
#[doc(alias = "ostree_gpg_error_quark")]
|
||||
pub fn gpg_error_quark() -> glib::Quark {
|
||||
unsafe {
|
||||
from_glib(ostree_sys::ostree_gpg_error_quark())
|
||||
from_glib(ffi::ostree_gpg_error_quark())
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_metadata_variant_type")]
|
||||
pub fn metadata_variant_type(objtype: ObjectType) -> Option<glib::VariantType> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_metadata_variant_type(objtype.to_glib()))
|
||||
from_glib_none(ffi::ostree_metadata_variant_type(objtype.into_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn object_from_string(str: &str) -> (GString, ObjectType) {
|
||||
#[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();
|
||||
ostree_sys::ostree_object_from_string(str.to_glib_none().0, &mut out_checksum, out_objtype.as_mut_ptr());
|
||||
ffi::ostree_object_from_string(str.to_glib_none().0, &mut out_checksum, out_objtype.as_mut_ptr());
|
||||
let out_objtype = out_objtype.assume_init();
|
||||
(from_glib_full(out_checksum), from_glib(out_objtype))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn object_name_deserialize(variant: &glib::Variant) -> (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();
|
||||
ostree_sys::ostree_object_name_deserialize(variant.to_glib_none().0, &mut out_checksum, out_objtype.as_mut_ptr());
|
||||
ffi::ostree_object_name_deserialize(variant.to_glib_none().0, &mut out_checksum, out_objtype.as_mut_ptr());
|
||||
let out_objtype = out_objtype.assume_init();
|
||||
(from_glib_none(out_checksum), from_glib(out_objtype))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_object_name_serialize")]
|
||||
pub fn object_name_serialize(checksum: &str, objtype: ObjectType) -> Option<glib::Variant> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_object_name_serialize(checksum.to_glib_none().0, objtype.to_glib()))
|
||||
from_glib_none(ffi::ostree_object_name_serialize(checksum.to_glib_none().0, objtype.into_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn object_to_string(checksum: &str, objtype: ObjectType) -> Option<GString> {
|
||||
#[doc(alias = "ostree_object_to_string")]
|
||||
pub fn object_to_string(checksum: &str, objtype: ObjectType) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_object_to_string(checksum.to_glib_none().0, objtype.to_glib()))
|
||||
from_glib_full(ffi::ostree_object_to_string(checksum.to_glib_none().0, objtype.into_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_object_type_from_string")]
|
||||
pub fn object_type_from_string(str: &str) -> ObjectType {
|
||||
unsafe {
|
||||
from_glib(ostree_sys::ostree_object_type_from_string(str.to_glib_none().0))
|
||||
from_glib(ffi::ostree_object_type_from_string(str.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn object_type_to_string(objtype: ObjectType) -> Option<GString> {
|
||||
#[doc(alias = "ostree_object_type_to_string")]
|
||||
pub fn object_type_to_string(objtype: ObjectType) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_object_type_to_string(objtype.to_glib()))
|
||||
from_glib_none(ffi::ostree_object_type_to_string(objtype.into_glib()))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn parse_refspec(refspec: &str) -> Result<(Option<GString>, GString), glib::Error> {
|
||||
#[doc(alias = "ostree_parse_refspec")]
|
||||
pub fn parse_refspec(refspec: &str) -> Result<(Option<glib::GString>, 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 _ = ostree_sys::ostree_parse_refspec(refspec.to_glib_none().0, &mut out_remote, &mut out_ref, &mut error);
|
||||
let _ = ffi::ostree_parse_refspec(refspec.to_glib_none().0, &mut out_remote, &mut out_ref, &mut error);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_raw_file_to_archive_z2_stream")]
|
||||
pub fn raw_file_to_archive_z2_stream<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(input: &P, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<gio::InputStream, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_input = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_raw_file_to_archive_z2_stream_with_options")]
|
||||
pub fn raw_file_to_archive_z2_stream_with_options<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(input: &P, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, options: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<gio::InputStream, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_input = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(from_glib_full(out_input)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_raw_file_to_content_stream")]
|
||||
pub fn raw_file_to_content_stream<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellable>>(input: &P, file_info: &gio::FileInfo, xattrs: Option<&glib::Variant>, cancellable: Option<&Q>) -> Result<(gio::InputStream, u64), glib::Error> {
|
||||
unsafe {
|
||||
let mut out_input = ptr::null_mut();
|
||||
let mut out_length = mem::MaybeUninit::uninit();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
let out_length = out_length.assume_init();
|
||||
if error.is_null() { Ok((from_glib_full(out_input), out_length)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_validate_checksum_string")]
|
||||
pub fn validate_checksum_string(sha256: &str) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_validate_checksum_string(sha256.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_validate_checksum_string(sha256.to_glib_none().0, &mut error);
|
||||
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")))]
|
||||
#[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 _ = ostree_sys::ostree_validate_collection_id(collection_id.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_validate_collection_id(collection_id.to_glib_none().0, &mut error);
|
||||
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")))]
|
||||
#[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 _ = ostree_sys::ostree_validate_remote_name(remote_name.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_validate_remote_name(remote_name.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_validate_rev")]
|
||||
pub fn validate_rev(rev: &str) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_validate_rev(rev.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_validate_rev(rev.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(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 _ = ostree_sys::ostree_validate_structureof_checksum_string(checksum.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_validate_structureof_checksum_string(checksum.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[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 _ = ostree_sys::ostree_validate_structureof_commit(commit.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_validate_structureof_commit(commit.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[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 _ = ostree_sys::ostree_validate_structureof_csum_v(checksum.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_validate_structureof_csum_v(checksum.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[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 _ = ostree_sys::ostree_validate_structureof_dirmeta(dirmeta.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_validate_structureof_dirmeta(dirmeta.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[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 _ = ostree_sys::ostree_validate_structureof_dirtree(dirtree.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_validate_structureof_dirtree(dirtree.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[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 _ = ostree_sys::ostree_validate_structureof_file_mode(mode, &mut error);
|
||||
let _ = ffi::ostree_validate_structureof_file_mode(mode, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(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 _ = ostree_sys::ostree_validate_structureof_objtype(objtype, &mut error);
|
||||
let _ = ffi::ostree_validate_structureof_objtype(objtype, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
44
rust-bindings/rust/src/auto/gpg_verify_result.rs
generated
44
rust-bindings/rust/src/auto/gpg_verify_result.rs
generated
@ -1,80 +1,90 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use crate::GpgSignatureFormatFlags;
|
||||
use glib::translate::*;
|
||||
use ostree_sys;
|
||||
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 GpgSignatureFormatFlags;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct GpgVerifyResult(Object<ostree_sys::OstreeGpgVerifyResult, GpgVerifyResultClass>);
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeGpgVerifyResult")]
|
||||
pub struct GpgVerifyResult(Object<ffi::OstreeGpgVerifyResult>);
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_gpg_verify_result_get_type(),
|
||||
type_ => || ffi::ostree_gpg_verify_result_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl GpgVerifyResult {
|
||||
#[doc(alias = "ostree_gpg_verify_result_count_all")]
|
||||
pub fn count_all(&self) -> u32 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_gpg_verify_result_count_all(self.to_glib_none().0)
|
||||
ffi::ostree_gpg_verify_result_count_all(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_gpg_verify_result_count_valid")]
|
||||
pub fn count_valid(&self) -> u32 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_gpg_verify_result_count_valid(self.to_glib_none().0)
|
||||
ffi::ostree_gpg_verify_result_count_valid(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_gpg_verify_result_describe")]
|
||||
pub fn describe(&self, signature_index: u32, output_buffer: &mut glib::String, line_prefix: Option<&str>, flags: GpgSignatureFormatFlags) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_gpg_verify_result_describe(self.to_glib_none().0, signature_index, output_buffer.to_glib_none_mut().0, line_prefix.to_glib_none().0, flags.to_glib());
|
||||
ffi::ostree_gpg_verify_result_describe(self.to_glib_none().0, signature_index, output_buffer.to_glib_none_mut().0, line_prefix.to_glib_none().0, flags.into_glib());
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "ostree_gpg_verify_result_get")]
|
||||
//pub fn get(&self, signature_index: u32, attrs: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 31 }) -> Option<glib::Variant> {
|
||||
// unsafe { TODO: call ostree_sys:ostree_gpg_verify_result_get() }
|
||||
// unsafe { TODO: call ffi:ostree_gpg_verify_result_get() }
|
||||
//}
|
||||
|
||||
pub fn get_all(&self, signature_index: u32) -> Option<glib::Variant> {
|
||||
#[doc(alias = "ostree_gpg_verify_result_get_all")]
|
||||
#[doc(alias = "get_all")]
|
||||
pub fn all(&self, signature_index: u32) -> Option<glib::Variant> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_gpg_verify_result_get_all(self.to_glib_none().0, signature_index))
|
||||
from_glib_full(ffi::ostree_gpg_verify_result_get_all(self.to_glib_none().0, signature_index))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_gpg_verify_result_lookup")]
|
||||
pub fn lookup(&self, key_id: &str) -> Option<u32> {
|
||||
unsafe {
|
||||
let mut out_signature_index = mem::MaybeUninit::uninit();
|
||||
let ret = from_glib(ostree_sys::ostree_gpg_verify_result_lookup(self.to_glib_none().0, key_id.to_glib_none().0, out_signature_index.as_mut_ptr()));
|
||||
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()));
|
||||
let out_signature_index = out_signature_index.assume_init();
|
||||
if ret { Some(out_signature_index) } else { None }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2016_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", 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 _ = ostree_sys::ostree_gpg_verify_result_require_valid_signature(self.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_gpg_verify_result_require_valid_signature(self.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_gpg_verify_result_describe_variant")]
|
||||
pub fn describe_variant(variant: &glib::Variant, output_buffer: &mut glib::String, line_prefix: Option<&str>, flags: GpgSignatureFormatFlags) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_gpg_verify_result_describe_variant(variant.to_glib_none().0, output_buffer.to_glib_none_mut().0, line_prefix.to_glib_none().0, flags.to_glib());
|
||||
ffi::ostree_gpg_verify_result_describe_variant(variant.to_glib_none().0, output_buffer.to_glib_none_mut().0, line_prefix.to_glib_none().0, flags.into_glib());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for GpgVerifyResult {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "GpgVerifyResult")
|
||||
f.write_str("GpgVerifyResult")
|
||||
}
|
||||
}
|
||||
|
98
rust-bindings/rust/src/auto/mod.rs
generated
98
rust-bindings/rust/src/auto/mod.rs
generated
@ -1,100 +1,104 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
mod async_progress;
|
||||
pub use self::async_progress::{AsyncProgress, AsyncProgressClass, NONE_ASYNC_PROGRESS};
|
||||
pub use self::async_progress::AsyncProgressExt;
|
||||
pub use self::async_progress::{AsyncProgress};
|
||||
|
||||
mod bootconfig_parser;
|
||||
pub use self::bootconfig_parser::{BootconfigParser, BootconfigParserClass};
|
||||
pub use self::bootconfig_parser::{BootconfigParser};
|
||||
|
||||
mod content_writer;
|
||||
pub use self::content_writer::{ContentWriter, ContentWriterClass, NONE_CONTENT_WRITER};
|
||||
pub use self::content_writer::ContentWriterExt;
|
||||
pub use self::content_writer::{ContentWriter};
|
||||
|
||||
mod deployment;
|
||||
pub use self::deployment::{Deployment, DeploymentClass};
|
||||
pub use self::deployment::{Deployment};
|
||||
|
||||
mod gpg_verify_result;
|
||||
pub use self::gpg_verify_result::{GpgVerifyResult, GpgVerifyResultClass};
|
||||
pub use self::gpg_verify_result::{GpgVerifyResult};
|
||||
|
||||
mod mutable_tree;
|
||||
pub use self::mutable_tree::{MutableTree, MutableTreeClass, NONE_MUTABLE_TREE};
|
||||
pub use self::mutable_tree::MutableTreeExt;
|
||||
pub use self::mutable_tree::{MutableTree};
|
||||
|
||||
mod repo;
|
||||
pub use self::repo::{Repo, RepoClass};
|
||||
pub use self::repo::{Repo};
|
||||
|
||||
mod repo_file;
|
||||
pub use self::repo_file::{RepoFile, RepoFileClass, NONE_REPO_FILE};
|
||||
pub use self::repo_file::RepoFileExt;
|
||||
pub use self::repo_file::{RepoFile};
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
mod repo_finder;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
pub use self::repo_finder::{RepoFinder, NONE_REPO_FINDER};
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use self::repo_finder::RepoFinderExt;
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
mod repo_finder_avahi;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use self::repo_finder_avahi::{RepoFinderAvahi, RepoFinderAvahiClass, NONE_REPO_FINDER_AVAHI};
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use self::repo_finder_avahi::RepoFinderAvahiExt;
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
pub use self::repo_finder_avahi::{RepoFinderAvahi};
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
mod repo_finder_config;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use self::repo_finder_config::{RepoFinderConfig, RepoFinderConfigClass, NONE_REPO_FINDER_CONFIG};
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
pub use self::repo_finder_config::{RepoFinderConfig};
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
mod repo_finder_mount;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use self::repo_finder_mount::{RepoFinderMount, RepoFinderMountClass, NONE_REPO_FINDER_MOUNT};
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use self::repo_finder_mount::RepoFinderMountExt;
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
pub use self::repo_finder_mount::{RepoFinderMount};
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
mod repo_finder_override;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use self::repo_finder_override::{RepoFinderOverride, RepoFinderOverrideClass, NONE_REPO_FINDER_OVERRIDE};
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use self::repo_finder_override::RepoFinderOverrideExt;
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
pub use self::repo_finder_override::{RepoFinderOverride};
|
||||
|
||||
mod se_policy;
|
||||
pub use self::se_policy::{SePolicy, SePolicyClass};
|
||||
pub use self::se_policy::{SePolicy};
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
||||
mod sign;
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
||||
pub use self::sign::{Sign, NONE_SIGN};
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
pub use self::sign::SignExt;
|
||||
|
||||
mod sysroot;
|
||||
pub use self::sysroot::{Sysroot, SysrootClass};
|
||||
pub use self::sysroot::{Sysroot};
|
||||
|
||||
mod sysroot_upgrader;
|
||||
pub use self::sysroot_upgrader::{SysrootUpgrader, SysrootUpgraderClass};
|
||||
pub use self::sysroot_upgrader::{SysrootUpgrader};
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
mod collection_ref;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", 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")))]
|
||||
mod commit_sizes_entry;
|
||||
#[cfg(any(feature = "v2020_1", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", 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")))]
|
||||
mod remote;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
pub use self::remote::Remote;
|
||||
|
||||
mod repo_commit_modifier;
|
||||
@ -104,8 +108,10 @@ 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")))]
|
||||
mod repo_finder_result;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
pub use self::repo_finder_result::RepoFinderResult;
|
||||
|
||||
mod enums;
|
||||
@ -113,6 +119,7 @@ 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")))]
|
||||
pub use self::enums::RepoCheckoutFilterResult;
|
||||
pub use self::enums::RepoCheckoutMode;
|
||||
pub use self::enums::RepoCheckoutOverwriteMode;
|
||||
@ -124,11 +131,13 @@ pub use self::enums::StaticDeltaGenerateOpt;
|
||||
|
||||
mod flags;
|
||||
#[cfg(any(feature = "v2017_13", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", 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")))]
|
||||
pub use self::flags::RepoCommitState;
|
||||
pub use self::flags::RepoCommitTraverseFlags;
|
||||
pub use self::flags::RepoListObjectsFlags;
|
||||
@ -146,32 +155,45 @@ pub 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")))]
|
||||
pub use self::constants::COMMIT_META_KEY_ARCHITECTURE;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", 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")))]
|
||||
pub use self::constants::COMMIT_META_KEY_ENDOFLIFE;
|
||||
#[cfg(any(feature = "v2017_7", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", 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")))]
|
||||
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")))]
|
||||
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")))]
|
||||
pub use self::constants::COMMIT_META_KEY_VERSION;
|
||||
pub use self::constants::DIRMETA_GVARIANT_STRING;
|
||||
pub use self::constants::FILEMETA_GVARIANT_STRING;
|
||||
#[cfg(any(feature = "v2021_1", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", 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")))]
|
||||
pub use self::constants::METADATA_KEY_LINUX;
|
||||
#[cfg(any(feature = "v2018_9", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", 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")))]
|
||||
pub use self::constants::ORIGIN_TRANSIENT_GROUP;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", 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")))]
|
||||
pub use self::constants::SIGN_NAME_ED25519;
|
||||
pub use self::constants::SUMMARY_GVARIANT_STRING;
|
||||
pub use self::constants::SUMMARY_SIG_GVARIANT_STRING;
|
||||
@ -179,18 +201,10 @@ pub use self::constants::TREE_GVARIANT_STRING;
|
||||
|
||||
#[doc(hidden)]
|
||||
pub mod traits {
|
||||
pub use super::AsyncProgressExt;
|
||||
pub use super::ContentWriterExt;
|
||||
pub use super::MutableTreeExt;
|
||||
pub use super::RepoFileExt;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use super::RepoFinderExt;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use super::RepoFinderAvahiExt;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use super::RepoFinderMountExt;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use super::RepoFinderOverrideExt;
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
pub use super::repo_finder::RepoFinderExt;
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
pub use super::SignExt;
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
||||
pub use super::sign::SignExt;
|
||||
}
|
||||
|
290
rust-bindings/rust/src/auto/mutable_tree.rs
generated
290
rust-bindings/rust/src/auto/mutable_tree.rs
generated
@ -1,36 +1,161 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
#[cfg(any(feature = "v2018_7", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_7")))]
|
||||
use crate::Repo;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
use std::ptr;
|
||||
#[cfg(any(feature = "v2018_7", feature = "dox"))]
|
||||
use Repo;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct MutableTree(Object<ostree_sys::OstreeMutableTree, ostree_sys::OstreeMutableTreeClass, MutableTreeClass>);
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeMutableTree")]
|
||||
pub struct MutableTree(Object<ffi::OstreeMutableTree, ffi::OstreeMutableTreeClass>);
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_mutable_tree_get_type(),
|
||||
type_ => || ffi::ostree_mutable_tree_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl MutableTree {
|
||||
#[doc(alias = "ostree_mutable_tree_new")]
|
||||
pub fn new() -> MutableTree {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_mutable_tree_new())
|
||||
from_glib_full(ffi::ostree_mutable_tree_new())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_7", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", 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 {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_mutable_tree_new_from_checksum(repo.to_glib_none().0, contents_checksum.to_glib_none().0, metadata_checksum.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_mutable_tree_new_from_checksum(repo.to_glib_none().0, contents_checksum.to_glib_none().0, metadata_checksum.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_7", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", 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 _ = ffi::ostree_mutable_tree_check_error(self.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_mutable_tree_ensure_dir")]
|
||||
pub fn ensure_dir(&self, name: &str) -> Result<MutableTree, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_subdir = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_mutable_tree_ensure_dir(self.to_glib_none().0, name.to_glib_none().0, &mut out_subdir, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(out_subdir)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_mutable_tree_ensure_parent_dirs")]
|
||||
pub fn ensure_parent_dirs(&self, split_path: &[&str], metadata_checksum: &str) -> Result<MutableTree, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_parent = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = 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);
|
||||
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")))]
|
||||
#[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 {
|
||||
from_glib(ffi::ostree_mutable_tree_fill_empty_from_dirtree(self.to_glib_none().0, repo.to_glib_none().0, contents_checksum.to_glib_none().0, metadata_checksum.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_mutable_tree_get_contents_checksum")]
|
||||
#[doc(alias = "get_contents_checksum")]
|
||||
pub fn contents_checksum(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ostree_mutable_tree_get_contents_checksum(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "ostree_mutable_tree_get_files")]
|
||||
//#[doc(alias = "get_files")]
|
||||
//pub fn files(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 } {
|
||||
// unsafe { TODO: call ffi:ostree_mutable_tree_get_files() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "ostree_mutable_tree_get_metadata_checksum")]
|
||||
#[doc(alias = "get_metadata_checksum")]
|
||||
pub fn metadata_checksum(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ostree_mutable_tree_get_metadata_checksum(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
//#[doc(alias = "ostree_mutable_tree_get_subdirs")]
|
||||
//#[doc(alias = "get_subdirs")]
|
||||
//pub fn subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 44 } {
|
||||
// unsafe { TODO: call ffi:ostree_mutable_tree_get_subdirs() }
|
||||
//}
|
||||
|
||||
#[doc(alias = "ostree_mutable_tree_lookup")]
|
||||
pub fn lookup(&self, name: &str) -> Result<(glib::GString, MutableTree), 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 _ = ffi::ostree_mutable_tree_lookup(self.to_glib_none().0, name.to_glib_none().0, &mut out_file_checksum, &mut out_subdir, &mut error);
|
||||
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")))]
|
||||
#[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 _ = ffi::ostree_mutable_tree_remove(self.to_glib_none().0, name.to_glib_none().0, allow_noent.into_glib(), &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[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 _ = ffi::ostree_mutable_tree_replace_file(self.to_glib_none().0, name.to_glib_none().0, checksum.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_mutable_tree_set_contents_checksum")]
|
||||
pub fn set_contents_checksum(&self, checksum: &str) {
|
||||
unsafe {
|
||||
ffi::ostree_mutable_tree_set_contents_checksum(self.to_glib_none().0, checksum.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_mutable_tree_set_metadata_checksum")]
|
||||
pub fn set_metadata_checksum(&self, checksum: &str) {
|
||||
unsafe {
|
||||
ffi::ostree_mutable_tree_set_metadata_checksum(self.to_glib_none().0, checksum.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_mutable_tree_walk")]
|
||||
pub fn walk(&self, split_path: &[&str], start: u32) -> Result<MutableTree, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_subdir = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_mutable_tree_walk(self.to_glib_none().0, split_path.to_glib_none().0, start, &mut out_subdir, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(out_subdir)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -41,147 +166,8 @@ impl Default for MutableTree {
|
||||
}
|
||||
}
|
||||
|
||||
pub const NONE_MUTABLE_TREE: Option<&MutableTree> = None;
|
||||
|
||||
pub trait MutableTreeExt: 'static {
|
||||
#[cfg(any(feature = "v2018_7", feature = "dox"))]
|
||||
fn check_error(&self) -> Result<(), glib::Error>;
|
||||
|
||||
fn ensure_dir(&self, name: &str) -> Result<MutableTree, glib::Error>;
|
||||
|
||||
fn ensure_parent_dirs(&self, split_path: &[&str], metadata_checksum: &str) -> Result<MutableTree, glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2018_7", feature = "dox"))]
|
||||
fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool;
|
||||
|
||||
fn get_contents_checksum(&self) -> Option<GString>;
|
||||
|
||||
//fn get_files(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 };
|
||||
|
||||
fn get_metadata_checksum(&self) -> Option<GString>;
|
||||
|
||||
//fn get_subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 44 };
|
||||
|
||||
fn lookup(&self, name: &str) -> Result<(GString, MutableTree), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2018_9", feature = "dox"))]
|
||||
fn remove(&self, name: &str, allow_noent: bool) -> Result<(), glib::Error>;
|
||||
|
||||
fn replace_file(&self, name: &str, checksum: &str) -> Result<(), glib::Error>;
|
||||
|
||||
fn set_contents_checksum(&self, checksum: &str);
|
||||
|
||||
fn set_metadata_checksum(&self, checksum: &str);
|
||||
|
||||
fn walk(&self, split_path: &[&str], start: u32) -> Result<MutableTree, glib::Error>;
|
||||
}
|
||||
|
||||
impl<O: IsA<MutableTree>> MutableTreeExt for O {
|
||||
#[cfg(any(feature = "v2018_7", feature = "dox"))]
|
||||
fn check_error(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_mutable_tree_check_error(self.as_ref().to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn ensure_dir(&self, name: &str) -> Result<MutableTree, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_subdir = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_mutable_tree_ensure_dir(self.as_ref().to_glib_none().0, name.to_glib_none().0, &mut out_subdir, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(out_subdir)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn ensure_parent_dirs(&self, split_path: &[&str], metadata_checksum: &str) -> Result<MutableTree, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_parent = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_mutable_tree_ensure_parent_dirs(self.as_ref().to_glib_none().0, split_path.to_glib_none().0, metadata_checksum.to_glib_none().0, &mut out_parent, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(out_parent)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_7", feature = "dox"))]
|
||||
fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool {
|
||||
unsafe {
|
||||
from_glib(ostree_sys::ostree_mutable_tree_fill_empty_from_dirtree(self.as_ref().to_glib_none().0, repo.to_glib_none().0, contents_checksum.to_glib_none().0, metadata_checksum.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_contents_checksum(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_mutable_tree_get_contents_checksum(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
//fn get_files(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 } {
|
||||
// unsafe { TODO: call ostree_sys:ostree_mutable_tree_get_files() }
|
||||
//}
|
||||
|
||||
fn get_metadata_checksum(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_mutable_tree_get_metadata_checksum(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
//fn get_subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 44 } {
|
||||
// unsafe { TODO: call ostree_sys:ostree_mutable_tree_get_subdirs() }
|
||||
//}
|
||||
|
||||
fn lookup(&self, name: &str) -> Result<(GString, MutableTree), glib::Error> {
|
||||
unsafe {
|
||||
let mut out_file_checksum = ptr::null_mut();
|
||||
let mut out_subdir = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_mutable_tree_lookup(self.as_ref().to_glib_none().0, name.to_glib_none().0, &mut out_file_checksum, &mut out_subdir, &mut error);
|
||||
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"))]
|
||||
fn remove(&self, name: &str, allow_noent: bool) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_mutable_tree_remove(self.as_ref().to_glib_none().0, name.to_glib_none().0, allow_noent.to_glib(), &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn replace_file(&self, name: &str, checksum: &str) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_mutable_tree_replace_file(self.as_ref().to_glib_none().0, name.to_glib_none().0, checksum.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn set_contents_checksum(&self, checksum: &str) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_mutable_tree_set_contents_checksum(self.as_ref().to_glib_none().0, checksum.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn set_metadata_checksum(&self, checksum: &str) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_mutable_tree_set_metadata_checksum(self.as_ref().to_glib_none().0, checksum.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
fn walk(&self, split_path: &[&str], start: u32) -> Result<MutableTree, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_subdir = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_mutable_tree_walk(self.as_ref().to_glib_none().0, split_path.to_glib_none().0, start, &mut out_subdir, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(out_subdir)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for MutableTree {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "MutableTree")
|
||||
f.write_str("MutableTree")
|
||||
}
|
||||
}
|
||||
|
30
rust-bindings/rust/src/auto/remote.rs
generated
30
rust-bindings/rust/src/auto/remote.rs
generated
@ -1,36 +1,34 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use glib::translate::*;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use glib::GString;
|
||||
use ostree_sys;
|
||||
|
||||
glib_wrapper! {
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct Remote(Shared<ostree_sys::OstreeRemote>);
|
||||
pub struct Remote(Shared<ffi::OstreeRemote>);
|
||||
|
||||
match fn {
|
||||
ref => |ptr| ostree_sys::ostree_remote_ref(ptr),
|
||||
unref => |ptr| ostree_sys::ostree_remote_unref(ptr),
|
||||
get_type => || ostree_sys::ostree_remote_get_type(),
|
||||
ref => |ptr| ffi::ostree_remote_ref(ptr),
|
||||
unref => |ptr| ffi::ostree_remote_unref(ptr),
|
||||
type_ => || ffi::ostree_remote_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Remote {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub fn get_name(&self) -> Option<GString> {
|
||||
#[doc(alias = "ostree_remote_get_name")]
|
||||
#[doc(alias = "get_name")]
|
||||
pub fn name(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_remote_get_name(self.to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_remote_get_name(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub fn get_url(&self) -> Option<GString> {
|
||||
#[doc(alias = "ostree_remote_get_url")]
|
||||
#[doc(alias = "get_url")]
|
||||
pub fn url(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_remote_get_url(self.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_remote_get_url(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
634
rust-bindings/rust/src/auto/repo.rs
generated
634
rust-bindings/rust/src/auto/repo.rs
generated
File diff suppressed because it is too large
Load Diff
62
rust-bindings/rust/src/auto/repo_commit_modifier.rs
generated
62
rust-bindings/rust/src/auto/repo_commit_modifier.rs
generated
@ -1,41 +1,41 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use gio;
|
||||
use glib;
|
||||
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 glib::GString;
|
||||
use ostree_sys;
|
||||
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 Repo;
|
||||
use RepoCommitFilterResult;
|
||||
use RepoCommitModifierFlags;
|
||||
#[cfg(any(feature = "v2017_13", feature = "dox"))]
|
||||
use RepoDevInoCache;
|
||||
use SePolicy;
|
||||
|
||||
glib_wrapper! {
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct RepoCommitModifier(Shared<ostree_sys::OstreeRepoCommitModifier>);
|
||||
pub struct RepoCommitModifier(Shared<ffi::OstreeRepoCommitModifier>);
|
||||
|
||||
match fn {
|
||||
ref => |ptr| ostree_sys::ostree_repo_commit_modifier_ref(ptr),
|
||||
unref => |ptr| ostree_sys::ostree_repo_commit_modifier_unref(ptr),
|
||||
get_type => || ostree_sys::ostree_repo_commit_modifier_get_type(),
|
||||
ref => |ptr| ffi::ostree_repo_commit_modifier_ref(ptr),
|
||||
unref => |ptr| ffi::ostree_repo_commit_modifier_unref(ptr),
|
||||
type_ => || ffi::ostree_repo_commit_modifier_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl RepoCommitModifier {
|
||||
#[doc(alias = "ostree_repo_commit_modifier_new")]
|
||||
pub fn new(flags: RepoCommitModifierFlags, commit_filter: Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>) -> RepoCommitModifier {
|
||||
let commit_filter_data: Box_<Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>> = Box_::new(commit_filter);
|
||||
unsafe extern "C" fn commit_filter_func(repo: *mut ostree_sys::OstreeRepo, path: *const libc::c_char, file_info: *mut gio_sys::GFileInfo, user_data: glib_sys::gpointer) -> ostree_sys::OstreeRepoCommitFilterResult {
|
||||
unsafe extern "C" fn commit_filter_func(repo: *mut ffi::OstreeRepo, path: *const libc::c_char, file_info: *mut gio::ffi::GFileInfo, user_data: glib::ffi::gpointer) -> ffi::OstreeRepoCommitFilterResult {
|
||||
let repo = from_glib_borrow(repo);
|
||||
let path: Borrowed<GString> = from_glib_borrow(path);
|
||||
let path: Borrowed<glib::GString> = from_glib_borrow(path);
|
||||
let file_info = from_glib_borrow(file_info);
|
||||
let callback: &Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>> = &*(user_data as *mut _);
|
||||
let res = if let Some(ref callback) = *callback {
|
||||
@ -43,59 +43,65 @@ impl RepoCommitModifier {
|
||||
} else {
|
||||
panic!("cannot get closure...")
|
||||
};
|
||||
res.to_glib()
|
||||
res.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_sys::gpointer) {
|
||||
unsafe extern "C" fn destroy_notify_func(data: glib::ffi::gpointer) {
|
||||
let _callback: Box_<Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>> = Box_::from_raw(data as *mut _);
|
||||
}
|
||||
let destroy_call3 = Some(destroy_notify_func as _);
|
||||
let super_callback0: Box_<Option<Box_<dyn Fn(&Repo, &str, &gio::FileInfo) -> RepoCommitFilterResult + 'static>>> = commit_filter_data;
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_repo_commit_modifier_new(flags.to_glib(), commit_filter, Box_::into_raw(super_callback0) as *mut _, destroy_call3))
|
||||
from_glib_full(ffi::ostree_repo_commit_modifier_new(flags.into_glib(), commit_filter, Box_::into_raw(super_callback0) as *mut _, destroy_call3))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2017_13", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
|
||||
#[doc(alias = "ostree_repo_commit_modifier_set_devino_cache")]
|
||||
pub fn set_devino_cache(&self, cache: &RepoDevInoCache) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_repo_commit_modifier_set_devino_cache(self.to_glib_none().0, cache.to_glib_none().0);
|
||||
ffi::ostree_repo_commit_modifier_set_devino_cache(self.to_glib_none().0, cache.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_repo_commit_modifier_set_sepolicy")]
|
||||
pub fn set_sepolicy(&self, sepolicy: Option<&SePolicy>) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_repo_commit_modifier_set_sepolicy(self.to_glib_none().0, sepolicy.to_glib_none().0);
|
||||
ffi::ostree_repo_commit_modifier_set_sepolicy(self.to_glib_none().0, sepolicy.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_4", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))]
|
||||
#[doc(alias = "ostree_repo_commit_modifier_set_sepolicy_from_commit")]
|
||||
pub fn set_sepolicy_from_commit<P: IsA<gio::Cancellable>>(&self, repo: &Repo, rev: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_repo_commit_modifier_set_xattr_callback")]
|
||||
pub fn set_xattr_callback<P: Fn(&Repo, &str, &gio::FileInfo) -> glib::Variant + 'static>(&self, callback: P) {
|
||||
let callback_data: Box_<P> = Box_::new(callback);
|
||||
unsafe extern "C" fn callback_func<P: Fn(&Repo, &str, &gio::FileInfo) -> glib::Variant + 'static>(repo: *mut ostree_sys::OstreeRepo, path: *const libc::c_char, file_info: *mut gio_sys::GFileInfo, user_data: glib_sys::gpointer) -> *mut glib_sys::GVariant {
|
||||
unsafe extern "C" fn callback_func<P: Fn(&Repo, &str, &gio::FileInfo) -> glib::Variant + 'static>(repo: *mut ffi::OstreeRepo, path: *const libc::c_char, file_info: *mut gio::ffi::GFileInfo, user_data: glib::ffi::gpointer) -> *mut glib::ffi::GVariant {
|
||||
let repo = from_glib_borrow(repo);
|
||||
let path: Borrowed<GString> = from_glib_borrow(path);
|
||||
let path: Borrowed<glib::GString> = 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 = Some(callback_func::<P> as _);
|
||||
unsafe extern "C" fn destroy_func<P: Fn(&Repo, &str, &gio::FileInfo) -> glib::Variant + 'static>(data: glib_sys::gpointer) {
|
||||
unsafe extern "C" fn destroy_func<P: Fn(&Repo, &str, &gio::FileInfo) -> glib::Variant + 'static>(data: glib::ffi::gpointer) {
|
||||
let _callback: Box_<P> = Box_::from_raw(data as *mut _);
|
||||
}
|
||||
let destroy_call2 = Some(destroy_func::<P> as _);
|
||||
let super_callback0: Box_<P> = callback_data;
|
||||
unsafe {
|
||||
ostree_sys::ostree_repo_commit_modifier_set_xattr_callback(self.to_glib_none().0, callback, destroy_call2, Box_::into_raw(super_callback0) as *mut _);
|
||||
ffi::ostree_repo_commit_modifier_set_xattr_callback(self.to_glib_none().0, callback, destroy_call2, Box_::into_raw(super_callback0) as *mut _);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
16
rust-bindings/rust/src/auto/repo_dev_ino_cache.rs
generated
16
rust-bindings/rust/src/auto/repo_dev_ino_cache.rs
generated
@ -1,25 +1,25 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib::translate::*;
|
||||
use ostree_sys;
|
||||
|
||||
glib_wrapper! {
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct RepoDevInoCache(Shared<ostree_sys::OstreeRepoDevInoCache>);
|
||||
pub struct RepoDevInoCache(Shared<ffi::OstreeRepoDevInoCache>);
|
||||
|
||||
match fn {
|
||||
ref => |ptr| ostree_sys::ostree_repo_devino_cache_ref(ptr),
|
||||
unref => |ptr| ostree_sys::ostree_repo_devino_cache_unref(ptr),
|
||||
get_type => || ostree_sys::ostree_repo_devino_cache_get_type(),
|
||||
ref => |ptr| ffi::ostree_repo_devino_cache_ref(ptr),
|
||||
unref => |ptr| ffi::ostree_repo_devino_cache_unref(ptr),
|
||||
type_ => || ffi::ostree_repo_devino_cache_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl RepoDevInoCache {
|
||||
#[doc(alias = "ostree_repo_devino_cache_new")]
|
||||
pub fn new() -> RepoDevInoCache {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_repo_devino_cache_new())
|
||||
from_glib_full(ffi::ostree_repo_devino_cache_new())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
111
rust-bindings/rust/src/auto/repo_file.rs
generated
111
rust-bindings/rust/src/auto/repo_file.rs
generated
@ -1,142 +1,127 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use gio;
|
||||
use glib;
|
||||
use crate::Repo;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
use Repo;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct RepoFile(Object<ostree_sys::OstreeRepoFile, ostree_sys::OstreeRepoFileClass, RepoFileClass>) @implements gio::File;
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeRepoFile")]
|
||||
pub struct RepoFile(Object<ffi::OstreeRepoFile, ffi::OstreeRepoFileClass>) @implements gio::File;
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_repo_file_get_type(),
|
||||
type_ => || ffi::ostree_repo_file_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
pub const NONE_REPO_FILE: Option<&RepoFile> = None;
|
||||
|
||||
pub trait RepoFileExt: 'static {
|
||||
fn ensure_resolved(&self) -> Result<(), glib::Error>;
|
||||
|
||||
fn get_checksum(&self) -> Option<GString>;
|
||||
|
||||
fn get_repo(&self) -> Option<Repo>;
|
||||
|
||||
fn get_root(&self) -> Option<RepoFile>;
|
||||
|
||||
fn get_xattrs<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<glib::Variant, glib::Error>;
|
||||
|
||||
fn tree_find_child(&self, name: &str) -> (i32, bool, glib::Variant);
|
||||
|
||||
fn tree_get_contents(&self) -> Option<glib::Variant>;
|
||||
|
||||
fn tree_get_contents_checksum(&self) -> Option<GString>;
|
||||
|
||||
fn tree_get_metadata(&self) -> Option<glib::Variant>;
|
||||
|
||||
fn tree_get_metadata_checksum(&self) -> Option<GString>;
|
||||
|
||||
fn tree_query_child<P: IsA<gio::Cancellable>>(&self, n: i32, attributes: &str, flags: gio::FileQueryInfoFlags, cancellable: Option<&P>) -> Result<gio::FileInfo, glib::Error>;
|
||||
|
||||
fn tree_set_metadata(&self, checksum: &str, metadata: &glib::Variant);
|
||||
}
|
||||
|
||||
impl<O: IsA<RepoFile>> RepoFileExt for O {
|
||||
fn ensure_resolved(&self) -> Result<(), glib::Error> {
|
||||
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 _ = ostree_sys::ostree_repo_file_ensure_resolved(self.as_ref().to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_repo_file_ensure_resolved(self.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn get_checksum(&self) -> Option<GString> {
|
||||
#[doc(alias = "ostree_repo_file_get_checksum")]
|
||||
#[doc(alias = "get_checksum")]
|
||||
pub fn checksum(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_repo_file_get_checksum(self.as_ref().to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_repo_file_get_checksum(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_repo(&self) -> Option<Repo> {
|
||||
#[doc(alias = "ostree_repo_file_get_repo")]
|
||||
#[doc(alias = "get_repo")]
|
||||
pub fn repo(&self) -> Option<Repo> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_repo_file_get_repo(self.as_ref().to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_repo_file_get_repo(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_root(&self) -> Option<RepoFile> {
|
||||
#[doc(alias = "ostree_repo_file_get_root")]
|
||||
#[doc(alias = "get_root")]
|
||||
pub fn root(&self) -> Option<RepoFile> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_repo_file_get_root(self.as_ref().to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_repo_file_get_root(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_xattrs<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<glib::Variant, glib::Error> {
|
||||
#[doc(alias = "ostree_repo_file_get_xattrs")]
|
||||
#[doc(alias = "get_xattrs")]
|
||||
pub fn xattrs<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<glib::Variant, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_xattrs = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_repo_file_get_xattrs(self.as_ref().to_glib_none().0, &mut out_xattrs, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(from_glib_full(out_xattrs)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn tree_find_child(&self, name: &str) -> (i32, bool, glib::Variant) {
|
||||
#[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 ret = ostree_sys::ostree_repo_file_tree_find_child(self.as_ref().to_glib_none().0, name.to_glib_none().0, is_dir.as_mut_ptr(), &mut out_container);
|
||||
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);
|
||||
let is_dir = is_dir.assume_init();
|
||||
(ret, from_glib(is_dir), from_glib_full(out_container))
|
||||
}
|
||||
}
|
||||
|
||||
fn tree_get_contents(&self) -> Option<glib::Variant> {
|
||||
#[doc(alias = "ostree_repo_file_tree_get_contents")]
|
||||
pub fn tree_get_contents(&self) -> Option<glib::Variant> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_repo_file_tree_get_contents(self.as_ref().to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_repo_file_tree_get_contents(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn tree_get_contents_checksum(&self) -> Option<GString> {
|
||||
#[doc(alias = "ostree_repo_file_tree_get_contents_checksum")]
|
||||
pub fn tree_get_contents_checksum(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_repo_file_tree_get_contents_checksum(self.as_ref().to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_repo_file_tree_get_contents_checksum(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn tree_get_metadata(&self) -> Option<glib::Variant> {
|
||||
#[doc(alias = "ostree_repo_file_tree_get_metadata")]
|
||||
pub fn tree_get_metadata(&self) -> Option<glib::Variant> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_repo_file_tree_get_metadata(self.as_ref().to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_repo_file_tree_get_metadata(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn tree_get_metadata_checksum(&self) -> Option<GString> {
|
||||
#[doc(alias = "ostree_repo_file_tree_get_metadata_checksum")]
|
||||
pub fn tree_get_metadata_checksum(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_repo_file_tree_get_metadata_checksum(self.as_ref().to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_repo_file_tree_get_metadata_checksum(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn tree_query_child<P: IsA<gio::Cancellable>>(&self, n: i32, attributes: &str, flags: gio::FileQueryInfoFlags, cancellable: Option<&P>) -> Result<gio::FileInfo, glib::Error> {
|
||||
#[doc(alias = "ostree_repo_file_tree_query_child")]
|
||||
pub fn tree_query_child<P: IsA<gio::Cancellable>>(&self, n: i32, attributes: &str, flags: gio::FileQueryInfoFlags, cancellable: Option<&P>) -> Result<gio::FileInfo, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_info = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_repo_file_tree_query_child(self.as_ref().to_glib_none().0, n, attributes.to_glib_none().0, flags.to_glib(), &mut out_info, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(from_glib_full(out_info)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn tree_set_metadata(&self, checksum: &str, metadata: &glib::Variant) {
|
||||
#[doc(alias = "ostree_repo_file_tree_set_metadata")]
|
||||
pub fn tree_set_metadata(&self, checksum: &str, metadata: &glib::Variant) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_repo_file_tree_set_metadata(self.as_ref().to_glib_none().0, checksum.to_glib_none().0, metadata.to_glib_none().0);
|
||||
ffi::ostree_repo_file_tree_set_metadata(self.to_glib_none().0, checksum.to_glib_none().0, metadata.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoFile {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoFile")
|
||||
f.write_str("RepoFile")
|
||||
}
|
||||
}
|
||||
|
20
rust-bindings/rust/src/auto/repo_finder.rs
generated
20
rust-bindings/rust/src/auto/repo_finder.rs
generated
@ -1,25 +1,19 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use gio;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use glib;
|
||||
use crate::RepoFinderResult;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use std::ptr;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use RepoFinderResult;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct RepoFinder(Interface<ostree_sys::OstreeRepoFinder>);
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeRepoFinder")]
|
||||
pub struct RepoFinder(Interface<ffi::OstreeRepoFinder, ffi::OstreeRepoFinderInterface>);
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_repo_finder_get_type(),
|
||||
type_ => || ffi::ostree_repo_finder_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,6 +27,6 @@ impl<O: IsA<RepoFinder>> RepoFinderExt for O {}
|
||||
|
||||
impl fmt::Display for RepoFinder {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoFinder")
|
||||
f.write_str("RepoFinder")
|
||||
}
|
||||
}
|
||||
|
46
rust-bindings/rust/src/auto/repo_finder_avahi.rs
generated
46
rust-bindings/rust/src/auto/repo_finder_avahi.rs
generated
@ -1,64 +1,48 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use crate::RepoFinder;
|
||||
use glib::translate::*;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use std::ptr;
|
||||
use RepoFinder;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct RepoFinderAvahi(Object<ostree_sys::OstreeRepoFinderAvahi, ostree_sys::OstreeRepoFinderAvahiClass, RepoFinderAvahiClass>) @implements RepoFinder;
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeRepoFinderAvahi")]
|
||||
pub struct RepoFinderAvahi(Object<ffi::OstreeRepoFinderAvahi, ffi::OstreeRepoFinderAvahiClass>) @implements RepoFinder;
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_repo_finder_avahi_get_type(),
|
||||
type_ => || ffi::ostree_repo_finder_avahi_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl RepoFinderAvahi {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[doc(alias = "ostree_repo_finder_avahi_new")]
|
||||
pub fn new(context: Option<&glib::MainContext>) -> RepoFinderAvahi {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_repo_finder_avahi_new(context.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_repo_finder_avahi_new(context.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub const NONE_REPO_FINDER_AVAHI: Option<&RepoFinderAvahi> = None;
|
||||
|
||||
pub trait RepoFinderAvahiExt: 'static {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn start(&self) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn stop(&self);
|
||||
}
|
||||
|
||||
impl<O: IsA<RepoFinderAvahi>> RepoFinderAvahiExt for O {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn start(&self) -> Result<(), glib::Error> {
|
||||
#[doc(alias = "ostree_repo_finder_avahi_start")]
|
||||
pub fn start(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_repo_finder_avahi_start(self.as_ref().to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_repo_finder_avahi_start(self.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn stop(&self) {
|
||||
#[doc(alias = "ostree_repo_finder_avahi_stop")]
|
||||
pub fn stop(&self) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_repo_finder_avahi_stop(self.as_ref().to_glib_none().0);
|
||||
ffi::ostree_repo_finder_avahi_stop(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoFinderAvahi {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoFinderAvahi")
|
||||
f.write_str("RepoFinderAvahi")
|
||||
}
|
||||
}
|
||||
|
21
rust-bindings/rust/src/auto/repo_finder_config.rs
generated
21
rust-bindings/rust/src/auto/repo_finder_config.rs
generated
@ -1,40 +1,39 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use crate::RepoFinder;
|
||||
use glib::translate::*;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
use RepoFinder;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct RepoFinderConfig(Object<ostree_sys::OstreeRepoFinderConfig, ostree_sys::OstreeRepoFinderConfigClass, RepoFinderConfigClass>) @implements RepoFinder;
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeRepoFinderConfig")]
|
||||
pub struct RepoFinderConfig(Object<ffi::OstreeRepoFinderConfig, ffi::OstreeRepoFinderConfigClass>) @implements RepoFinder;
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_repo_finder_config_get_type(),
|
||||
type_ => || ffi::ostree_repo_finder_config_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl RepoFinderConfig {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[doc(alias = "ostree_repo_finder_config_new")]
|
||||
pub fn new() -> RepoFinderConfig {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_repo_finder_config_new())
|
||||
from_glib_full(ffi::ostree_repo_finder_config_new())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
impl Default for RepoFinderConfig {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
pub const NONE_REPO_FINDER_CONFIG: Option<&RepoFinderConfig> = None;
|
||||
|
||||
impl fmt::Display for RepoFinderConfig {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoFinderConfig")
|
||||
f.write_str("RepoFinderConfig")
|
||||
}
|
||||
}
|
||||
|
42
rust-bindings/rust/src/auto/repo_finder_mount.rs
generated
42
rust-bindings/rust/src/auto/repo_finder_mount.rs
generated
@ -1,51 +1,37 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use gio;
|
||||
use crate::RepoFinder;
|
||||
use glib::object::IsA;
|
||||
use glib::object::ObjectType as ObjectType_;
|
||||
use glib::translate::*;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use glib::StaticType;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use glib::Value;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use gobject_sys;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
use RepoFinder;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct RepoFinderMount(Object<ostree_sys::OstreeRepoFinderMount, ostree_sys::OstreeRepoFinderMountClass, RepoFinderMountClass>) @implements RepoFinder;
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeRepoFinderMount")]
|
||||
pub struct RepoFinderMount(Object<ffi::OstreeRepoFinderMount, ffi::OstreeRepoFinderMountClass>) @implements RepoFinder;
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_repo_finder_mount_get_type(),
|
||||
type_ => || ffi::ostree_repo_finder_mount_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl RepoFinderMount {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[doc(alias = "ostree_repo_finder_mount_new")]
|
||||
pub fn new<P: IsA<gio::VolumeMonitor>>(monitor: Option<&P>) -> RepoFinderMount {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_repo_finder_mount_new(monitor.map(|p| p.as_ref()).to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_repo_finder_mount_new(monitor.map(|p| p.as_ref()).to_glib_none().0))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub const NONE_REPO_FINDER_MOUNT: Option<&RepoFinderMount> = None;
|
||||
|
||||
pub trait RepoFinderMountExt: 'static {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn get_property_monitor(&self) -> Option<gio::VolumeMonitor>;
|
||||
}
|
||||
|
||||
impl<O: IsA<RepoFinderMount>> RepoFinderMountExt for O {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn get_property_monitor(&self) -> Option<gio::VolumeMonitor> {
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
pub fn monitor(&self) -> Option<gio::VolumeMonitor> {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<gio::VolumeMonitor as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(self.to_glib_none().0 as *mut gobject_sys::GObject, b"monitor\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
||||
let mut value = glib::Value::from_type(<gio::VolumeMonitor as StaticType>::static_type());
|
||||
glib::gobject_ffi::g_object_get_property(self.as_ptr() as *mut glib::gobject_ffi::GObject, b"monitor\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
||||
value.get().expect("Return Value for property `monitor` getter")
|
||||
}
|
||||
}
|
||||
@ -53,6 +39,6 @@ impl<O: IsA<RepoFinderMount>> RepoFinderMountExt for O {
|
||||
|
||||
impl fmt::Display for RepoFinderMount {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoFinderMount")
|
||||
f.write_str("RepoFinderMount")
|
||||
}
|
||||
}
|
||||
|
43
rust-bindings/rust/src/auto/repo_finder_override.rs
generated
43
rust-bindings/rust/src/auto/repo_finder_override.rs
generated
@ -1,55 +1,46 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use glib::object::IsA;
|
||||
use crate::RepoFinder;
|
||||
use glib::translate::*;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
use RepoFinder;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct RepoFinderOverride(Object<ostree_sys::OstreeRepoFinderOverride, ostree_sys::OstreeRepoFinderOverrideClass, RepoFinderOverrideClass>) @implements RepoFinder;
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeRepoFinderOverride")]
|
||||
pub struct RepoFinderOverride(Object<ffi::OstreeRepoFinderOverride, ffi::OstreeRepoFinderOverrideClass>) @implements RepoFinder;
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_repo_finder_override_get_type(),
|
||||
type_ => || ffi::ostree_repo_finder_override_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl RepoFinderOverride {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[doc(alias = "ostree_repo_finder_override_new")]
|
||||
pub fn new() -> RepoFinderOverride {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_repo_finder_override_new())
|
||||
from_glib_full(ffi::ostree_repo_finder_override_new())
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_repo_finder_override_add_uri")]
|
||||
pub fn add_uri(&self, uri: &str) {
|
||||
unsafe {
|
||||
ffi::ostree_repo_finder_override_add_uri(self.to_glib_none().0, uri.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||
impl Default for RepoFinderOverride {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
pub const NONE_REPO_FINDER_OVERRIDE: Option<&RepoFinderOverride> = None;
|
||||
|
||||
pub trait RepoFinderOverrideExt: 'static {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn add_uri(&self, uri: &str);
|
||||
}
|
||||
|
||||
impl<O: IsA<RepoFinderOverride>> RepoFinderOverrideExt for O {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn add_uri(&self, uri: &str) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_repo_finder_override_add_uri(self.as_ref().to_glib_none().0, uri.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for RepoFinderOverride {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "RepoFinderOverride")
|
||||
f.write_str("RepoFinderOverride")
|
||||
}
|
||||
}
|
||||
|
25
rust-bindings/rust/src/auto/repo_finder_result.rs
generated
25
rust-bindings/rust/src/auto/repo_finder_result.rs
generated
@ -1,34 +1,31 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use glib::translate::*;
|
||||
use gobject_sys;
|
||||
use ostree_sys;
|
||||
use std::cmp;
|
||||
use glib::translate::*;
|
||||
|
||||
glib_wrapper! {
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, Hash)]
|
||||
pub struct RepoFinderResult(Boxed<ostree_sys::OstreeRepoFinderResult>);
|
||||
pub struct RepoFinderResult(Boxed<ffi::OstreeRepoFinderResult>);
|
||||
|
||||
match fn {
|
||||
copy => |ptr| gobject_sys::g_boxed_copy(ostree_sys::ostree_repo_finder_result_get_type(), ptr as *mut _) as *mut ostree_sys::OstreeRepoFinderResult,
|
||||
free => |ptr| gobject_sys::g_boxed_free(ostree_sys::ostree_repo_finder_result_get_type(), ptr as *mut _),
|
||||
get_type => || ostree_sys::ostree_repo_finder_result_get_type(),
|
||||
copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::ostree_repo_finder_result_get_type(), ptr as *mut _) as *mut ffi::OstreeRepoFinderResult,
|
||||
free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::ostree_repo_finder_result_get_type(), ptr as *mut _),
|
||||
type_ => || ffi::ostree_repo_finder_result_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl RepoFinderResult {
|
||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
//#[doc(alias = "ostree_repo_finder_result_new")]
|
||||
//pub fn new<P: IsA<RepoFinder>>(remote: &Remote, finder: &P, priority: i32, ref_to_checksum: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 1, id: 0 }/TypeId { ns_id: 0, id: 28 }, ref_to_timestamp: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 1, id: 0 }/TypeId { ns_id: 0, id: 9 }, summary_last_modified: u64) -> RepoFinderResult {
|
||||
// unsafe { TODO: call ostree_sys:ostree_repo_finder_result_new() }
|
||||
// unsafe { TODO: call ffi:ostree_repo_finder_result_new() }
|
||||
//}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
#[doc(alias = "ostree_repo_finder_result_compare")]
|
||||
fn compare(&self, b: &RepoFinderResult) -> i32 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_repo_finder_result_compare(self.to_glib_none().0, b.to_glib_none().0)
|
||||
ffi::ostree_repo_finder_result_compare(self.to_glib_none().0, b.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
68
rust-bindings/rust/src/auto/se_policy.rs
generated
68
rust-bindings/rust/src/auto/se_policy.rs
generated
@ -1,103 +1,113 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use gio;
|
||||
use glib;
|
||||
use crate::SePolicyRestoreconFlags;
|
||||
use glib::object::IsA;
|
||||
use glib::object::ObjectType as ObjectType_;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use gobject_sys;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
use std::ptr;
|
||||
use SePolicyRestoreconFlags;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct SePolicy(Object<ostree_sys::OstreeSePolicy, SePolicyClass>);
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeSePolicy")]
|
||||
pub struct SePolicy(Object<ffi::OstreeSePolicy>);
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_sepolicy_get_type(),
|
||||
type_ => || ffi::ostree_sepolicy_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl SePolicy {
|
||||
#[doc(alias = "ostree_sepolicy_new")]
|
||||
pub fn new<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(path: &P, cancellable: Option<&Q>) -> Result<SePolicy, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_sepolicy_new(path.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_sepolicy_new_at")]
|
||||
pub fn new_at<P: IsA<gio::Cancellable>>(rootfs_dfd: i32, cancellable: Option<&P>) -> Result<SePolicy, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_sepolicy_new_at(rootfs_dfd, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
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)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2016_5", feature = "dox"))]
|
||||
pub fn get_csum(&self) -> Option<GString> {
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))]
|
||||
#[doc(alias = "ostree_sepolicy_get_csum")]
|
||||
#[doc(alias = "get_csum")]
|
||||
pub fn csum(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sepolicy_get_csum(self.to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_sepolicy_get_csum(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_label<P: IsA<gio::Cancellable>>(&self, relpath: &str, unix_mode: u32, cancellable: Option<&P>) -> Result<GString, glib::Error> {
|
||||
#[doc(alias = "ostree_sepolicy_get_label")]
|
||||
#[doc(alias = "get_label")]
|
||||
pub fn label<P: IsA<gio::Cancellable>>(&self, relpath: &str, unix_mode: u32, cancellable: Option<&P>) -> Result<glib::GString, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_label = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(from_glib_full(out_label)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_name(&self) -> Option<GString> {
|
||||
#[doc(alias = "ostree_sepolicy_get_name")]
|
||||
#[doc(alias = "get_name")]
|
||||
pub fn name(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sepolicy_get_name(self.to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_sepolicy_get_name(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_path(&self) -> Option<gio::File> {
|
||||
#[doc(alias = "ostree_sepolicy_get_path")]
|
||||
#[doc(alias = "get_path")]
|
||||
pub fn path(&self) -> Option<gio::File> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sepolicy_get_path(self.to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_sepolicy_get_path(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn restorecon<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, path: &str, info: Option<&gio::FileInfo>, target: &P, flags: SePolicyRestoreconFlags, cancellable: Option<&Q>) -> Result<GString, glib::Error> {
|
||||
#[doc(alias = "ostree_sepolicy_restorecon")]
|
||||
pub fn restorecon<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(&self, path: &str, info: Option<&gio::FileInfo>, target: &P, flags: SePolicyRestoreconFlags, cancellable: Option<&Q>) -> Result<glib::GString, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_new_label = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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.to_glib(), &mut out_new_label, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(from_glib_full(out_new_label)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sepolicy_setfscreatecon")]
|
||||
pub fn setfscreatecon(&self, path: &str, mode: u32) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sepolicy_setfscreatecon(self.to_glib_none().0, path.to_glib_none().0, mode, &mut error);
|
||||
let _ = ffi::ostree_sepolicy_setfscreatecon(self.to_glib_none().0, path.to_glib_none().0, mode, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_property_rootfs_dfd(&self) -> i32 {
|
||||
#[doc(alias = "rootfs-dfd")]
|
||||
pub fn rootfs_dfd(&self) -> i32 {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<i32 as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"rootfs-dfd\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
||||
value.get().expect("Return Value for property `rootfs-dfd` getter").unwrap()
|
||||
let mut value = glib::Value::from_type(<i32 as StaticType>::static_type());
|
||||
glib::gobject_ffi::g_object_get_property(self.as_ptr() as *mut glib::gobject_ffi::GObject, b"rootfs-dfd\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
||||
value.get().expect("Return Value for property `rootfs-dfd` getter")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for SePolicy {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "SePolicy")
|
||||
f.write_str("SePolicy")
|
||||
}
|
||||
}
|
||||
|
122
rust-bindings/rust/src/auto/sign.rs
generated
122
rust-bindings/rust/src/auto/sign.rs
generated
@ -1,43 +1,37 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
use gio;
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
use glib;
|
||||
use crate::Repo;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
use glib::GString;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
use std::ptr;
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
use Repo;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Sign(Interface<ostree_sys::OstreeSign>);
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeSign")]
|
||||
pub struct Sign(Interface<ffi::OstreeSign, ffi::OstreeSignInterface>);
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_sign_get_type(),
|
||||
type_ => || ffi::ostree_sign_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Sign {
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
pub fn get_all() -> Vec<Sign> {
|
||||
#[doc(alias = "ostree_sign_get_all")]
|
||||
#[doc(alias = "get_all")]
|
||||
pub fn all() -> Vec<Sign> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ostree_sys::ostree_sign_get_all())
|
||||
FromGlibPtrContainer::from_glib_full(ffi::ostree_sign_get_all())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
pub fn get_by_name(name: &str) -> Result<Sign, glib::Error> {
|
||||
#[doc(alias = "ostree_sign_get_by_name")]
|
||||
#[doc(alias = "get_by_name")]
|
||||
pub fn by_name(name: &str) -> Result<Sign, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_sign_get_by_name(name.to_glib_none().0, &mut error);
|
||||
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)) }
|
||||
}
|
||||
}
|
||||
@ -46,157 +40,145 @@ impl Sign {
|
||||
pub const NONE_SIGN: Option<&Sign> = None;
|
||||
|
||||
pub trait SignExt: 'static {
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
#[doc(alias = "ostree_sign_add_pk")]
|
||||
fn add_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
#[doc(alias = "ostree_sign_clear_keys")]
|
||||
fn clear_keys(&self) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
#[doc(alias = "ostree_sign_commit")]
|
||||
fn commit<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn commit_verify<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<Option<GString>, glib::Error>;
|
||||
#[doc(alias = "ostree_sign_commit_verify")]
|
||||
fn commit_verify<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<Option<glib::GString>, glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
#[doc(alias = "ostree_sign_data")]
|
||||
fn data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, cancellable: Option<&P>) -> Result<glib::Bytes, glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result<Option<GString>, glib::Error>;
|
||||
#[doc(alias = "ostree_sign_data_verify")]
|
||||
fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result<Option<glib::GString>, glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn get_name(&self) -> Option<GString>;
|
||||
#[doc(alias = "ostree_sign_get_name")]
|
||||
#[doc(alias = "get_name")]
|
||||
fn name(&self) -> Option<glib::GString>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
#[doc(alias = "ostree_sign_load_pk")]
|
||||
fn load_pk(&self, options: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn metadata_format(&self) -> Option<GString>;
|
||||
#[doc(alias = "ostree_sign_metadata_format")]
|
||||
fn metadata_format(&self) -> Option<glib::GString>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn metadata_key(&self) -> Option<GString>;
|
||||
#[doc(alias = "ostree_sign_metadata_key")]
|
||||
fn metadata_key(&self) -> Option<glib::GString>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
#[doc(alias = "ostree_sign_set_pk")]
|
||||
fn set_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
#[doc(alias = "ostree_sign_set_sk")]
|
||||
fn set_sk(&self, secret_key: &glib::Variant) -> Result<(), glib::Error>;
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
#[doc(alias = "ostree_sign_summary")]
|
||||
fn summary<P: IsA<gio::Cancellable>>(&self, repo: &Repo, keys: &glib::Variant, cancellable: Option<&P>) -> Result<(), glib::Error>;
|
||||
}
|
||||
|
||||
impl<O: IsA<Sign>> SignExt for O {
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn add_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_add_pk(self.as_ref().to_glib_none().0, public_key.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_sign_add_pk(self.as_ref().to_glib_none().0, public_key.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn clear_keys(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_clear_keys(self.as_ref().to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_sign_clear_keys(self.as_ref().to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn commit<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn commit_verify<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<Option<GString>, glib::Error> {
|
||||
fn commit_verify<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<Option<glib::GString>, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_success_message = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(from_glib_full(out_success_message)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, cancellable: Option<&P>) -> Result<glib::Bytes, glib::Error> {
|
||||
unsafe {
|
||||
let mut signature = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(from_glib_full(signature)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result<Option<GString>, glib::Error> {
|
||||
fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result<Option<glib::GString>, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_success_message = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(from_glib_full(out_success_message)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn get_name(&self) -> Option<GString> {
|
||||
fn name(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sign_get_name(self.as_ref().to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_sign_get_name(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn load_pk(&self, options: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_load_pk(self.as_ref().to_glib_none().0, options.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_sign_load_pk(self.as_ref().to_glib_none().0, options.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn metadata_format(&self) -> Option<GString> {
|
||||
fn metadata_format(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sign_metadata_format(self.as_ref().to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_sign_metadata_format(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn metadata_key(&self) -> Option<GString> {
|
||||
fn metadata_key(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sign_metadata_key(self.as_ref().to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_sign_metadata_key(self.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn set_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_set_pk(self.as_ref().to_glib_none().0, public_key.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_sign_set_pk(self.as_ref().to_glib_none().0, public_key.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn set_sk(&self, secret_key: &glib::Variant) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sign_set_sk(self.as_ref().to_glib_none().0, secret_key.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_sign_set_sk(self.as_ref().to_glib_none().0, secret_key.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||
fn summary<P: IsA<gio::Cancellable>>(&self, repo: &Repo, keys: &glib::Variant, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
@ -204,6 +186,6 @@ impl<O: IsA<Sign>> SignExt for O {
|
||||
|
||||
impl fmt::Display for Sign {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "Sign")
|
||||
f.write_str("Sign")
|
||||
}
|
||||
}
|
||||
|
263
rust-bindings/rust/src/auto/sysroot.rs
generated
263
rust-bindings/rust/src/auto/sysroot.rs
generated
@ -1,433 +1,498 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use gio;
|
||||
use gio_sys;
|
||||
use glib;
|
||||
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 glib::GString;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
#[cfg(any(feature = "v2017_10", feature = "dox"))]
|
||||
use libc;
|
||||
use ostree_sys;
|
||||
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 Deployment;
|
||||
#[cfg(any(feature = "v2016_4", feature = "dox"))]
|
||||
use DeploymentUnlockedState;
|
||||
use Repo;
|
||||
#[cfg(any(feature = "v2020_7", feature = "dox"))]
|
||||
use SysrootDeployTreeOpts;
|
||||
use SysrootSimpleWriteDeploymentFlags;
|
||||
#[cfg(any(feature = "v2017_4", feature = "dox"))]
|
||||
use SysrootWriteDeploymentsOpts;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct Sysroot(Object<ostree_sys::OstreeSysroot, SysrootClass>);
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeSysroot")]
|
||||
pub struct Sysroot(Object<ffi::OstreeSysroot>);
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_sysroot_get_type(),
|
||||
type_ => || ffi::ostree_sysroot_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Sysroot {
|
||||
#[doc(alias = "ostree_sysroot_new")]
|
||||
pub fn new<P: IsA<gio::File>>(path: Option<&P>) -> Sysroot {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_sysroot_new(path.map(|p| p.as_ref()).to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_sysroot_new(path.map(|p| p.as_ref()).to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_new_default")]
|
||||
pub fn new_default() -> Sysroot {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_sysroot_new_default())
|
||||
from_glib_full(ffi::ostree_sysroot_new_default())
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_cleanup")]
|
||||
pub fn cleanup<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_cleanup(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_sysroot_cleanup(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
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")))]
|
||||
//#[doc(alias = "ostree_sysroot_cleanup_prune_repo")]
|
||||
//pub fn cleanup_prune_repo<P: IsA<gio::Cancellable>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: Option<&P>) -> Result<(i32, i32, u64), glib::Error> {
|
||||
// unsafe { TODO: call ostree_sys:ostree_sysroot_cleanup_prune_repo() }
|
||||
// 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")))]
|
||||
#[doc(alias = "ostree_sysroot_deploy_tree")]
|
||||
pub fn deploy_tree<P: IsA<gio::Cancellable>>(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, provided_merge_deployment: Option<&Deployment>, override_kernel_argv: &[&str], cancellable: Option<&P>) -> Result<Deployment, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_new_deployment = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_sysroot_deploy_tree_with_options")]
|
||||
pub fn deploy_tree_with_options<P: IsA<gio::Cancellable>>(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, provided_merge_deployment: Option<&Deployment>, opts: Option<&SysrootDeployTreeOpts>, cancellable: Option<&P>) -> Result<Deployment, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_new_deployment = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(from_glib_full(out_new_deployment)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_deployment_set_kargs")]
|
||||
pub fn deployment_set_kargs<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, new_kargs: &[&str], cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_deployment_set_kargs(self.to_glib_none().0, deployment.to_glib_none().0, new_kargs.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_deployment_set_mutable")]
|
||||
pub fn deployment_set_mutable<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, is_mutable: bool, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_deployment_set_mutable(self.to_glib_none().0, deployment.to_glib_none().0, is_mutable.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
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")))]
|
||||
#[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 _ = ostree_sys::ostree_sysroot_deployment_set_pinned(self.to_glib_none().0, deployment.to_glib_none().0, is_pinned.to_glib(), &mut error);
|
||||
let _ = ffi::ostree_sysroot_deployment_set_pinned(self.to_glib_none().0, deployment.to_glib_none().0, is_pinned.into_glib(), &mut error);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_sysroot_deployment_unlock")]
|
||||
pub fn deployment_unlock<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, unlocked_state: DeploymentUnlockedState, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_deployment_unlock(self.to_glib_none().0, deployment.to_glib_none().0, unlocked_state.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_ensure_initialized")]
|
||||
pub fn ensure_initialized<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_ensure_initialized(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_sysroot_ensure_initialized(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_booted_deployment(&self) -> Option<Deployment> {
|
||||
#[doc(alias = "ostree_sysroot_get_booted_deployment")]
|
||||
#[doc(alias = "get_booted_deployment")]
|
||||
pub fn booted_deployment(&self) -> Option<Deployment> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sysroot_get_booted_deployment(self.to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_sysroot_get_booted_deployment(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_bootversion(&self) -> i32 {
|
||||
#[doc(alias = "ostree_sysroot_get_bootversion")]
|
||||
#[doc(alias = "get_bootversion")]
|
||||
pub fn bootversion(&self) -> i32 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_sysroot_get_bootversion(self.to_glib_none().0)
|
||||
ffi::ostree_sysroot_get_bootversion(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_deployment_directory(&self, deployment: &Deployment) -> Option<gio::File> {
|
||||
#[doc(alias = "ostree_sysroot_get_deployment_directory")]
|
||||
#[doc(alias = "get_deployment_directory")]
|
||||
pub fn deployment_directory(&self, deployment: &Deployment) -> Option<gio::File> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_sysroot_get_deployment_directory(self.to_glib_none().0, deployment.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_sysroot_get_deployment_directory(self.to_glib_none().0, deployment.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_deployment_dirpath(&self, deployment: &Deployment) -> Option<GString> {
|
||||
#[doc(alias = "ostree_sysroot_get_deployment_dirpath")]
|
||||
#[doc(alias = "get_deployment_dirpath")]
|
||||
pub fn deployment_dirpath(&self, deployment: &Deployment) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_sysroot_get_deployment_dirpath(self.to_glib_none().0, deployment.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_sysroot_get_deployment_dirpath(self.to_glib_none().0, deployment.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_deployments(&self) -> Vec<Deployment> {
|
||||
#[doc(alias = "ostree_sysroot_get_deployments")]
|
||||
#[doc(alias = "get_deployments")]
|
||||
pub fn deployments(&self) -> Vec<Deployment> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_container(ostree_sys::ostree_sysroot_get_deployments(self.to_glib_none().0))
|
||||
FromGlibPtrContainer::from_glib_container(ffi::ostree_sysroot_get_deployments(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_fd(&self) -> i32 {
|
||||
#[doc(alias = "ostree_sysroot_get_fd")]
|
||||
#[doc(alias = "get_fd")]
|
||||
pub fn fd(&self) -> i32 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_sysroot_get_fd(self.to_glib_none().0)
|
||||
ffi::ostree_sysroot_get_fd(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_merge_deployment(&self, osname: Option<&str>) -> Option<Deployment> {
|
||||
#[doc(alias = "ostree_sysroot_get_merge_deployment")]
|
||||
#[doc(alias = "get_merge_deployment")]
|
||||
pub fn merge_deployment(&self, osname: Option<&str>) -> Option<Deployment> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_sysroot_get_merge_deployment(self.to_glib_none().0, osname.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_sysroot_get_merge_deployment(self.to_glib_none().0, osname.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_path(&self) -> Option<gio::File> {
|
||||
#[doc(alias = "ostree_sysroot_get_path")]
|
||||
#[doc(alias = "get_path")]
|
||||
pub fn path(&self) -> Option<gio::File> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sysroot_get_path(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_repo<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<Repo, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_repo = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_get_repo(self.to_glib_none().0, &mut out_repo, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(out_repo)) } else { Err(from_glib_full(error)) }
|
||||
from_glib_none(ffi::ostree_sysroot_get_path(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_5", feature = "dox"))]
|
||||
pub fn get_staged_deployment(&self) -> Option<Deployment> {
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_5")))]
|
||||
#[doc(alias = "ostree_sysroot_get_staged_deployment")]
|
||||
#[doc(alias = "get_staged_deployment")]
|
||||
pub fn staged_deployment(&self) -> Option<Deployment> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sysroot_get_staged_deployment(self.to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_sysroot_get_staged_deployment(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_subbootversion(&self) -> i32 {
|
||||
#[doc(alias = "ostree_sysroot_get_subbootversion")]
|
||||
#[doc(alias = "get_subbootversion")]
|
||||
pub fn subbootversion(&self) -> i32 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_sysroot_get_subbootversion(self.to_glib_none().0)
|
||||
ffi::ostree_sysroot_get_subbootversion(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2016_4", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
|
||||
#[doc(alias = "ostree_sysroot_init_osname")]
|
||||
pub fn init_osname<P: IsA<gio::Cancellable>>(&self, osname: &str, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_init_osname(self.to_glib_none().0, osname.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_sysroot_initialize")]
|
||||
pub fn initialize(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_initialize(self.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_sysroot_initialize(self.to_glib_none().0, &mut error);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_sysroot_is_booted")]
|
||||
pub fn is_booted(&self) -> bool {
|
||||
unsafe {
|
||||
from_glib(ostree_sys::ostree_sysroot_is_booted(self.to_glib_none().0))
|
||||
from_glib(ffi::ostree_sysroot_is_booted(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_load")]
|
||||
pub fn load<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_load(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_sysroot_load(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_sysroot_load_if_changed")]
|
||||
pub fn load_if_changed<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<bool, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_changed = mem::MaybeUninit::uninit();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
let out_changed = out_changed.assume_init();
|
||||
if error.is_null() { Ok(from_glib(out_changed)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_lock")]
|
||||
pub fn lock(&self) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_lock(self.to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_sysroot_lock(self.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_lock_async")]
|
||||
pub fn lock_async<P: IsA<gio::Cancellable>, Q: FnOnce(Result<(), glib::Error>) + Send + 'static>(&self, cancellable: Option<&P>, callback: Q) {
|
||||
let user_data: Box_<Q> = Box_::new(callback);
|
||||
unsafe extern "C" fn lock_async_trampoline<Q: FnOnce(Result<(), glib::Error>) + Send + 'static>(_source_object: *mut gobject_sys::GObject, res: *mut gio_sys::GAsyncResult, user_data: glib_sys::gpointer) {
|
||||
unsafe extern "C" fn lock_async_trampoline<Q: FnOnce(Result<(), glib::Error>) + Send + '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 _ = ostree_sys::ostree_sysroot_lock_finish(_source_object as *mut _, res, &mut error);
|
||||
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_<Q> = Box_::from_raw(user_data as *mut _);
|
||||
callback(result);
|
||||
}
|
||||
let callback = lock_async_trampoline::<Q>;
|
||||
unsafe {
|
||||
ostree_sys::ostree_sysroot_lock_async(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, Some(callback), Box_::into_raw(user_data) as *mut _);
|
||||
ffi::ostree_sysroot_lock_async(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, Some(callback), Box_::into_raw(user_data) as *mut _);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pub fn lock_async_future(&self) -> Pin<Box_<dyn std::future::Future<Output = Result<(), glib::Error>> + 'static>> {
|
||||
|
||||
Box_::pin(gio::GioFuture::new(self, move |obj, send| {
|
||||
let cancellable = gio::Cancellable::new();
|
||||
Box_::pin(gio::GioFuture::new(self, move |obj, cancellable, send| {
|
||||
obj.lock_async(
|
||||
Some(&cancellable),
|
||||
Some(cancellable),
|
||||
move |res| {
|
||||
send.resolve(res);
|
||||
},
|
||||
);
|
||||
|
||||
cancellable
|
||||
}))
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_origin_new_from_refspec")]
|
||||
pub fn origin_new_from_refspec(&self, refspec: &str) -> Option<glib::KeyFile> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_sysroot_origin_new_from_refspec(self.to_glib_none().0, refspec.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_sysroot_origin_new_from_refspec(self.to_glib_none().0, refspec.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_prepare_cleanup")]
|
||||
pub fn prepare_cleanup<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_prepare_cleanup(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_sysroot_prepare_cleanup(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_sysroot_query_deployments_for")]
|
||||
pub fn query_deployments_for(&self, osname: Option<&str>) -> (Option<Deployment>, Option<Deployment>) {
|
||||
unsafe {
|
||||
let mut out_pending = ptr::null_mut();
|
||||
let mut out_rollback = ptr::null_mut();
|
||||
ostree_sys::ostree_sysroot_query_deployments_for(self.to_glib_none().0, osname.to_glib_none().0, &mut out_pending, &mut out_rollback);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_sysroot_repo")]
|
||||
pub fn repo(&self) -> Option<Repo> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sysroot_repo(self.to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_sysroot_repo(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2021_1", feature = "dox"))]
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))]
|
||||
#[doc(alias = "ostree_sysroot_require_booted_deployment")]
|
||||
pub fn require_booted_deployment(&self) -> Result<Deployment, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_sysroot_require_booted_deployment(self.to_glib_none().0, &mut error);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_sysroot_set_mount_namespace_in_use")]
|
||||
pub fn set_mount_namespace_in_use(&self) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_sysroot_set_mount_namespace_in_use(self.to_glib_none().0);
|
||||
ffi::ostree_sysroot_set_mount_namespace_in_use(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_simple_write_deployment")]
|
||||
pub fn simple_write_deployment<P: IsA<gio::Cancellable>>(&self, osname: Option<&str>, new_deployment: &Deployment, merge_deployment: Option<&Deployment>, flags: SysrootSimpleWriteDeploymentFlags, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_simple_write_deployment(self.to_glib_none().0, osname.to_glib_none().0, new_deployment.to_glib_none().0, merge_deployment.to_glib_none().0, flags.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2020_7", feature = "dox"))]
|
||||
pub fn stage_overlay_initrd<P: IsA<gio::Cancellable>>(&self, fd: i32, cancellable: Option<&P>) -> Result<GString, glib::Error> {
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))]
|
||||
#[doc(alias = "ostree_sysroot_stage_overlay_initrd")]
|
||||
pub fn stage_overlay_initrd<P: IsA<gio::Cancellable>>(&self, fd: i32, cancellable: Option<&P>) -> Result<glib::GString, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_checksum = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_sysroot_stage_tree")]
|
||||
pub fn stage_tree<P: IsA<gio::Cancellable>>(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, merge_deployment: Option<&Deployment>, override_kernel_argv: &[&str], cancellable: Option<&P>) -> Result<Deployment, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_new_deployment = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_sysroot_stage_tree_with_options")]
|
||||
pub fn stage_tree_with_options<P: IsA<gio::Cancellable>>(&self, osname: Option<&str>, revision: &str, origin: Option<&glib::KeyFile>, merge_deployment: Option<&Deployment>, opts: &SysrootDeployTreeOpts, cancellable: Option<&P>) -> Result<Deployment, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_new_deployment = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(from_glib_full(out_new_deployment)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_try_lock")]
|
||||
pub fn try_lock(&self) -> Result<bool, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_acquired = mem::MaybeUninit::uninit();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_try_lock(self.to_glib_none().0, out_acquired.as_mut_ptr(), &mut error);
|
||||
let _ = ffi::ostree_sysroot_try_lock(self.to_glib_none().0, out_acquired.as_mut_ptr(), &mut error);
|
||||
let out_acquired = out_acquired.assume_init();
|
||||
if error.is_null() { Ok(from_glib(out_acquired)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_unload")]
|
||||
pub fn unload(&self) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_sysroot_unload(self.to_glib_none().0);
|
||||
ffi::ostree_sysroot_unload(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_unlock")]
|
||||
pub fn unlock(&self) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_sysroot_unlock(self.to_glib_none().0);
|
||||
ffi::ostree_sysroot_unlock(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_write_deployments")]
|
||||
pub fn write_deployments<P: IsA<gio::Cancellable>>(&self, new_deployments: &[Deployment], cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
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")))]
|
||||
#[doc(alias = "ostree_sysroot_write_deployments_with_options")]
|
||||
pub fn write_deployments_with_options<P: IsA<gio::Cancellable>>(&self, new_deployments: &[Deployment], opts: &SysrootWriteDeploymentsOpts, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::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);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_write_origin_file")]
|
||||
pub fn write_origin_file<P: IsA<gio::Cancellable>>(&self, deployment: &Deployment, new_origin: Option<&glib::KeyFile>, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_write_origin_file(self.to_glib_none().0, deployment.to_glib_none().0, new_origin.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_deployment_origin_path<P: IsA<gio::File>>(deployment_path: &P) -> Option<gio::File> {
|
||||
#[doc(alias = "ostree_sysroot_get_deployment_origin_path")]
|
||||
#[doc(alias = "get_deployment_origin_path")]
|
||||
pub fn deployment_origin_path<P: IsA<gio::File>>(deployment_path: &P) -> Option<gio::File> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_sysroot_get_deployment_origin_path(deployment_path.as_ref().to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_sysroot_get_deployment_origin_path(deployment_path.as_ref().to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2017_10", feature = "dox"))]
|
||||
pub fn connect_journal_msg<F: Fn(&Sysroot, &str) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn journal_msg_trampoline<F: Fn(&Sysroot, &str) + 'static>(this: *mut ostree_sys::OstreeSysroot, msg: *mut libc::c_char, f: glib_sys::gpointer) {
|
||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))]
|
||||
#[doc(alias = "journal-msg")]
|
||||
pub fn connect_journal_msg<F: Fn(&Self, &str) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe extern "C" fn journal_msg_trampoline<F: Fn(&Sysroot, &str) + 'static>(this: *mut ffi::OstreeSysroot, msg: *mut libc::c_char, f: glib::ffi::gpointer) {
|
||||
let f: &F = &*(f as *const F);
|
||||
f(&from_glib_borrow(this), &GString::from_glib_borrow(msg))
|
||||
f(&from_glib_borrow(this), &glib::GString::from_glib_borrow(msg))
|
||||
}
|
||||
unsafe {
|
||||
let f: Box_<F> = Box_::new(f);
|
||||
@ -439,6 +504,6 @@ impl Sysroot {
|
||||
|
||||
impl fmt::Display for Sysroot {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "Sysroot")
|
||||
f.write_str("Sysroot")
|
||||
}
|
||||
}
|
||||
|
98
rust-bindings/rust/src/auto/sysroot_upgrader.rs
generated
98
rust-bindings/rust/src/auto/sysroot_upgrader.rs
generated
@ -1,142 +1,152 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
use gio;
|
||||
use glib;
|
||||
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::GString;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use gobject_sys;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
use AsyncProgress;
|
||||
use Repo;
|
||||
use RepoPullFlags;
|
||||
use Sysroot;
|
||||
use SysrootUpgraderFlags;
|
||||
use SysrootUpgraderPullFlags;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct SysrootUpgrader(Object<ostree_sys::OstreeSysrootUpgrader, SysrootUpgraderClass>);
|
||||
glib::wrapper! {
|
||||
#[doc(alias = "OstreeSysrootUpgrader")]
|
||||
pub struct SysrootUpgrader(Object<ffi::OstreeSysrootUpgrader>);
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_sysroot_upgrader_get_type(),
|
||||
type_ => || ffi::ostree_sysroot_upgrader_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl SysrootUpgrader {
|
||||
#[doc(alias = "ostree_sysroot_upgrader_new")]
|
||||
pub fn new<P: IsA<gio::Cancellable>>(sysroot: &Sysroot, cancellable: Option<&P>) -> Result<SysrootUpgrader, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_sysroot_upgrader_new(sysroot.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
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)) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_for_os<P: IsA<gio::Cancellable>>(sysroot: &Sysroot, osname: Option<&str>, cancellable: Option<&P>) -> Result<SysrootUpgrader, glib::Error> {
|
||||
#[doc(alias = "ostree_sysroot_upgrader_new_for_os")]
|
||||
#[doc(alias = "new_for_os")]
|
||||
pub fn for_os<P: IsA<gio::Cancellable>>(sysroot: &Sysroot, osname: Option<&str>, cancellable: Option<&P>) -> Result<SysrootUpgrader, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_sysroot_upgrader_new_for_os(sysroot.to_glib_none().0, osname.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
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)) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_for_os_with_flags<P: IsA<gio::Cancellable>>(sysroot: &Sysroot, osname: Option<&str>, flags: SysrootUpgraderFlags, cancellable: Option<&P>) -> Result<SysrootUpgrader, glib::Error> {
|
||||
#[doc(alias = "ostree_sysroot_upgrader_new_for_os_with_flags")]
|
||||
#[doc(alias = "new_for_os_with_flags")]
|
||||
pub fn for_os_with_flags<P: IsA<gio::Cancellable>>(sysroot: &Sysroot, osname: Option<&str>, flags: SysrootUpgraderFlags, cancellable: Option<&P>) -> Result<SysrootUpgrader, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_sysroot_upgrader_new_for_os_with_flags(sysroot.to_glib_none().0, osname.to_glib_none().0, flags.to_glib(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
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)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_upgrader_deploy")]
|
||||
pub fn deploy<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_upgrader_deploy(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = ffi::ostree_sysroot_upgrader_deploy(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_upgrader_dup_origin")]
|
||||
pub fn dup_origin(&self) -> Option<glib::KeyFile> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_sysroot_upgrader_dup_origin(self.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_sysroot_upgrader_dup_origin(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_origin(&self) -> Option<glib::KeyFile> {
|
||||
#[doc(alias = "ostree_sysroot_upgrader_get_origin")]
|
||||
#[doc(alias = "get_origin")]
|
||||
pub fn origin(&self) -> Option<glib::KeyFile> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_sysroot_upgrader_get_origin(self.to_glib_none().0))
|
||||
from_glib_none(ffi::ostree_sysroot_upgrader_get_origin(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_origin_description(&self) -> Option<GString> {
|
||||
#[doc(alias = "ostree_sysroot_upgrader_get_origin_description")]
|
||||
#[doc(alias = "get_origin_description")]
|
||||
pub fn origin_description(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_sysroot_upgrader_get_origin_description(self.to_glib_none().0))
|
||||
from_glib_full(ffi::ostree_sysroot_upgrader_get_origin_description(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pull<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<bool, glib::Error> {
|
||||
#[doc(alias = "ostree_sysroot_upgrader_pull")]
|
||||
pub fn pull<P: IsA<gio::Cancellable>>(&self, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: Option<&AsyncProgress>, cancellable: Option<&P>) -> Result<bool, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_changed = mem::MaybeUninit::uninit();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_upgrader_pull(self.to_glib_none().0, flags.to_glib(), upgrader_flags.to_glib(), progress.map(|p| p.as_ref()).to_glib_none().0, out_changed.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
let out_changed = out_changed.assume_init();
|
||||
if error.is_null() { Ok(from_glib(out_changed)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn pull_one_dir<P: IsA<AsyncProgress>, Q: IsA<gio::Cancellable>>(&self, dir_to_pull: &str, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: Option<&P>, cancellable: Option<&Q>) -> Result<bool, glib::Error> {
|
||||
#[doc(alias = "ostree_sysroot_upgrader_pull_one_dir")]
|
||||
pub fn pull_one_dir<P: IsA<gio::Cancellable>>(&self, dir_to_pull: &str, flags: RepoPullFlags, upgrader_flags: SysrootUpgraderPullFlags, progress: Option<&AsyncProgress>, cancellable: Option<&P>) -> Result<bool, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_changed = mem::MaybeUninit::uninit();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_upgrader_pull_one_dir(self.to_glib_none().0, dir_to_pull.to_glib_none().0, flags.to_glib(), upgrader_flags.to_glib(), progress.map(|p| p.as_ref()).to_glib_none().0, out_changed.as_mut_ptr(), cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
let out_changed = out_changed.assume_init();
|
||||
if error.is_null() { Ok(from_glib(out_changed)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(alias = "ostree_sysroot_upgrader_set_origin")]
|
||||
pub fn set_origin<P: IsA<gio::Cancellable>>(&self, origin: Option<&glib::KeyFile>, cancellable: Option<&P>) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_sysroot_upgrader_set_origin(self.to_glib_none().0, origin.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_property_flags(&self) -> SysrootUpgraderFlags {
|
||||
pub fn flags(&self) -> SysrootUpgraderFlags {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<SysrootUpgraderFlags as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"flags\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
||||
value.get().expect("Return Value for property `flags` getter").unwrap()
|
||||
let mut value = glib::Value::from_type(<SysrootUpgraderFlags as StaticType>::static_type());
|
||||
glib::gobject_ffi::g_object_get_property(self.as_ptr() as *mut glib::gobject_ffi::GObject, b"flags\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
||||
value.get().expect("Return Value for property `flags` getter")
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_property_osname(&self) -> Option<GString> {
|
||||
pub fn osname(&self) -> Option<glib::GString> {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<GString as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"osname\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
||||
let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
|
||||
glib::gobject_ffi::g_object_get_property(self.as_ptr() as *mut glib::gobject_ffi::GObject, b"osname\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
||||
value.get().expect("Return Value for property `osname` getter")
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_property_sysroot(&self) -> Option<Sysroot> {
|
||||
pub fn sysroot(&self) -> Option<Sysroot> {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<Sysroot as StaticType>::static_type());
|
||||
gobject_sys::g_object_get_property(self.as_ptr() as *mut gobject_sys::GObject, b"sysroot\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
||||
let mut value = glib::Value::from_type(<Sysroot as StaticType>::static_type());
|
||||
glib::gobject_ffi::g_object_get_property(self.as_ptr() as *mut glib::gobject_ffi::GObject, b"sysroot\0".as_ptr() as *const _, value.to_glib_none_mut().0);
|
||||
value.get().expect("Return Value for property `sysroot` getter")
|
||||
}
|
||||
}
|
||||
|
||||
#[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 _ = ostree_sys::ostree_sysroot_upgrader_check_timestamps(repo.to_glib_none().0, from_rev.to_glib_none().0, to_rev.to_glib_none().0, &mut error);
|
||||
let _ = 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);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
@ -144,6 +154,6 @@ impl SysrootUpgrader {
|
||||
|
||||
impl fmt::Display for SysrootUpgrader {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "SysrootUpgrader")
|
||||
f.write_str("SysrootUpgrader")
|
||||
}
|
||||
}
|
||||
|
4
rust-bindings/rust/src/auto/versions.txt
generated
4
rust-bindings/rust/src/auto/versions.txt
generated
@ -1,2 +1,2 @@
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 2d1ffab)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ e4bcf9b+)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ e8f82cf6)
|
||||
from gir-files
|
||||
|
@ -3,7 +3,7 @@ use glib_sys::{g_free, g_malloc0, gpointer};
|
||||
use once_cell::sync::OnceCell;
|
||||
use std::ptr::copy_nonoverlapping;
|
||||
|
||||
const BYTES_LEN: usize = ostree_sys::OSTREE_SHA256_DIGEST_LEN as usize;
|
||||
const BYTES_LEN: usize = ffi::OSTREE_SHA256_DIGEST_LEN as usize;
|
||||
|
||||
static BASE64_CONFIG: OnceCell<radix64::CustomConfig> = OnceCell::new();
|
||||
|
||||
@ -120,10 +120,8 @@ impl Clone for Checksum {
|
||||
impl PartialEq for Checksum {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
unsafe {
|
||||
let ret = ostree_sys::ostree_cmp_checksum_bytes(
|
||||
self.bytes as *const u8,
|
||||
other.bytes as *const u8,
|
||||
);
|
||||
let ret =
|
||||
ffi::ostree_cmp_checksum_bytes(self.bytes as *const u8, other.bytes as *const u8);
|
||||
ret == 0
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::CollectionRef;
|
||||
use glib::translate::ToGlibPtr;
|
||||
use std::ffi::CStr;
|
||||
use CollectionRef;
|
||||
|
||||
trait AsNonnullPtr
|
||||
where
|
||||
|
@ -13,9 +13,9 @@ pub fn checksum_file<P: IsA<gio::File>, Q: IsA<gio::Cancellable>>(
|
||||
unsafe {
|
||||
let mut out_csum = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_checksum_file(
|
||||
let ret = ffi::ostree_checksum_file(
|
||||
f.as_ref().to_glib_none().0,
|
||||
objtype.to_glib(),
|
||||
objtype.into_glib(),
|
||||
&mut out_csum,
|
||||
cancellable.map(|p| p.as_ref()).to_glib_none().0,
|
||||
&mut error,
|
||||
@ -45,7 +45,7 @@ pub fn checksum_file_async<
|
||||
) {
|
||||
let mut error = ptr::null_mut();
|
||||
let mut out_csum = MaybeUninit::uninit();
|
||||
let ret = ostree_sys::ostree_checksum_file_async_finish(
|
||||
let ret = ffi::ostree_checksum_file_async_finish(
|
||||
_source_object as *mut _,
|
||||
res,
|
||||
out_csum.as_mut_ptr(),
|
||||
@ -58,9 +58,9 @@ pub fn checksum_file_async<
|
||||
}
|
||||
let callback = checksum_file_async_trampoline::<R>;
|
||||
unsafe {
|
||||
ostree_sys::ostree_checksum_file_async(
|
||||
ffi::ostree_checksum_file_async(
|
||||
f.as_ref().to_glib_none().0,
|
||||
objtype.to_glib(),
|
||||
objtype.into_glib(),
|
||||
io_priority,
|
||||
cancellable.map(|p| p.as_ref()).to_glib_none().0,
|
||||
Some(callback),
|
||||
@ -76,12 +76,10 @@ pub fn checksum_file_async_future<P: IsA<gio::File> + Clone + 'static>(
|
||||
io_priority: i32,
|
||||
) -> Pin<Box<dyn Future<Output = Result<Checksum, Box<dyn std::error::Error>>> + 'static>> {
|
||||
let f = f.clone();
|
||||
Box::pin(gio::GioFuture::new(&f, move |f, send| {
|
||||
let cancellable = gio::Cancellable::new();
|
||||
checksum_file_async(f, objtype, io_priority, Some(&cancellable), move |res| {
|
||||
Box::pin(gio::GioFuture::new(&f, move |f, cancellable, send| {
|
||||
checksum_file_async(f, objtype, io_priority, Some(cancellable), move |res| {
|
||||
send.resolve(res);
|
||||
});
|
||||
cancellable
|
||||
}))
|
||||
}
|
||||
|
||||
@ -95,11 +93,11 @@ pub fn checksum_file_from_input<P: IsA<gio::InputStream>, Q: IsA<gio::Cancellabl
|
||||
unsafe {
|
||||
let mut out_csum = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_checksum_file_from_input(
|
||||
let ret = ffi::ostree_checksum_file_from_input(
|
||||
file_info.to_glib_none().0,
|
||||
xattrs.to_glib_none().0,
|
||||
in_.map(|p| p.as_ref()).to_glib_none().0,
|
||||
objtype.to_glib(),
|
||||
objtype.into_glib(),
|
||||
&mut out_csum,
|
||||
cancellable.map(|p| p.as_ref()).to_glib_none().0,
|
||||
&mut error,
|
||||
@ -120,14 +118,14 @@ pub fn checksum_file_at<P: IsA<gio::Cancellable>>(
|
||||
unsafe {
|
||||
let mut out_checksum = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
ostree_sys::ostree_checksum_file_at(
|
||||
ffi::ostree_checksum_file_at(
|
||||
dfd,
|
||||
path.to_glib_none().0,
|
||||
stbuf
|
||||
.map(|p| p as *const libc::stat as *mut libc::stat)
|
||||
.unwrap_or(ptr::null_mut()),
|
||||
objtype.to_glib(),
|
||||
flags.to_glib(),
|
||||
objtype.into_glib(),
|
||||
flags.into_glib(),
|
||||
&mut out_checksum,
|
||||
cancellable.map(|p| p.as_ref()).to_glib_none().0,
|
||||
&mut error,
|
||||
@ -148,7 +146,7 @@ unsafe fn checksum_file_error(
|
||||
if !error.is_null() {
|
||||
Err(Box::<glib::Error>::new(from_glib_full(error)))
|
||||
} else if ret == GFALSE {
|
||||
Err(Box::new(glib_bool_error!("unknown error")))
|
||||
Err(Box::new(glib::bool_error!("unknown error")))
|
||||
} else {
|
||||
Ok(Checksum::from_glib_full(out_csum))
|
||||
}
|
||||
|
@ -1,3 +1,4 @@
|
||||
use ffi::OstreeKernelArgs;
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
use gio;
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
@ -5,18 +6,16 @@ use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
use glib::GString;
|
||||
use ostree_sys;
|
||||
use ostree_sys::OstreeKernelArgs;
|
||||
use std::fmt;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
glib::wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct KernelArgs(Boxed<ostree_sys::OstreeKernelArgs>);
|
||||
pub struct KernelArgs(Boxed<ffi::OstreeKernelArgs>);
|
||||
|
||||
match fn {
|
||||
copy => |_ptr| unimplemented!(),
|
||||
free => |ptr| ostree_sys::ostree_kernel_args_free(ptr),
|
||||
free => |ptr| ffi::ostree_kernel_args_free(ptr),
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,24 +23,21 @@ impl KernelArgs {
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
pub fn append(&mut self, arg: &str) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_kernel_args_append(self.to_glib_none_mut().0, arg.to_glib_none().0);
|
||||
ffi::ostree_kernel_args_append(self.to_glib_none_mut().0, arg.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
pub fn append_argv(&mut self, argv: &[&str]) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_kernel_args_append_argv(
|
||||
self.to_glib_none_mut().0,
|
||||
argv.to_glib_none().0,
|
||||
);
|
||||
ffi::ostree_kernel_args_append_argv(self.to_glib_none_mut().0, argv.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
pub fn append_argv_filtered(&mut self, argv: &[&str], prefixes: &[&str]) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_kernel_args_append_argv_filtered(
|
||||
ffi::ostree_kernel_args_append_argv_filtered(
|
||||
self.to_glib_none_mut().0,
|
||||
argv.to_glib_none().0,
|
||||
prefixes.to_glib_none().0,
|
||||
@ -56,7 +52,7 @@ impl KernelArgs {
|
||||
) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_kernel_args_append_proc_cmdline(
|
||||
let _ = ffi::ostree_kernel_args_append_proc_cmdline(
|
||||
self.to_glib_none_mut().0,
|
||||
cancellable.map(|p| p.as_ref()).to_glib_none().0,
|
||||
&mut error,
|
||||
@ -72,7 +68,7 @@ impl KernelArgs {
|
||||
pub fn delete(&mut self, arg: &str) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_kernel_args_delete(
|
||||
let _ = ffi::ostree_kernel_args_delete(
|
||||
self.to_glib_none_mut().0,
|
||||
arg.to_glib_none().0,
|
||||
&mut error,
|
||||
@ -89,7 +85,7 @@ impl KernelArgs {
|
||||
pub fn delete_key_entry(&mut self, key: &str) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_kernel_args_delete_key_entry(
|
||||
let _ = ffi::ostree_kernel_args_delete_key_entry(
|
||||
self.to_glib_none_mut().0,
|
||||
key.to_glib_none().0,
|
||||
&mut error,
|
||||
@ -105,7 +101,7 @@ impl KernelArgs {
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
pub fn get_last_value(&self, key: &str) -> Option<GString> {
|
||||
unsafe {
|
||||
from_glib_none(ostree_sys::ostree_kernel_args_get_last_value(
|
||||
from_glib_none(ffi::ostree_kernel_args_get_last_value(
|
||||
self.to_glib_none().0 as *mut OstreeKernelArgs,
|
||||
key.to_glib_none().0,
|
||||
))
|
||||
@ -116,7 +112,7 @@ impl KernelArgs {
|
||||
pub fn new_replace(&mut self, arg: &str) -> Result<(), glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_kernel_args_new_replace(
|
||||
let _ = ffi::ostree_kernel_args_new_replace(
|
||||
self.to_glib_none_mut().0,
|
||||
arg.to_glib_none().0,
|
||||
&mut error,
|
||||
@ -132,7 +128,7 @@ impl KernelArgs {
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
pub fn parse_append(&mut self, options: &str) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_kernel_args_parse_append(
|
||||
ffi::ostree_kernel_args_parse_append(
|
||||
self.to_glib_none_mut().0,
|
||||
options.to_glib_none().0,
|
||||
);
|
||||
@ -142,34 +138,28 @@ impl KernelArgs {
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
pub fn replace(&mut self, arg: &str) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_kernel_args_replace(self.to_glib_none_mut().0, arg.to_glib_none().0);
|
||||
ffi::ostree_kernel_args_replace(self.to_glib_none_mut().0, arg.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
pub fn replace_argv(&mut self, argv: &[&str]) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_kernel_args_replace_argv(
|
||||
self.to_glib_none_mut().0,
|
||||
argv.to_glib_none().0,
|
||||
);
|
||||
ffi::ostree_kernel_args_replace_argv(self.to_glib_none_mut().0, argv.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
pub fn replace_take(&mut self, arg: &str) {
|
||||
unsafe {
|
||||
ostree_sys::ostree_kernel_args_replace_take(
|
||||
self.to_glib_none_mut().0,
|
||||
arg.to_glib_full(),
|
||||
);
|
||||
ffi::ostree_kernel_args_replace_take(self.to_glib_none_mut().0, arg.to_glib_full());
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
fn to_gstring(&self) -> GString {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_kernel_args_to_string(
|
||||
from_glib_full(ffi::ostree_kernel_args_to_string(
|
||||
self.to_glib_none().0 as *mut OstreeKernelArgs,
|
||||
))
|
||||
}
|
||||
@ -178,7 +168,7 @@ impl KernelArgs {
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
pub fn to_strv(&self) -> Vec<GString> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ostree_sys::ostree_kernel_args_to_strv(
|
||||
FromGlibPtrContainer::from_glib_full(ffi::ostree_kernel_args_to_strv(
|
||||
self.to_glib_none().0 as *mut OstreeKernelArgs,
|
||||
))
|
||||
}
|
||||
@ -190,7 +180,7 @@ impl KernelArgs {
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
pub fn from_string(options: &str) -> KernelArgs {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_kernel_args_from_string(
|
||||
from_glib_full(ffi::ostree_kernel_args_from_string(
|
||||
options.to_glib_none().0,
|
||||
))
|
||||
}
|
||||
@ -198,7 +188,7 @@ impl KernelArgs {
|
||||
|
||||
#[cfg(any(feature = "v2019_3", feature = "dox"))]
|
||||
pub fn new() -> KernelArgs {
|
||||
unsafe { from_glib_full(ostree_sys::ostree_kernel_args_new()) }
|
||||
unsafe { from_glib_full(ffi::ostree_kernel_args_new()) }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,21 +6,6 @@
|
||||
|
||||
#![doc(html_root_url = "https://fkrull.gitlab.io/ostree-rs")]
|
||||
|
||||
extern crate gio_sys;
|
||||
extern crate glib_sys;
|
||||
extern crate gobject_sys;
|
||||
extern crate ostree_sys;
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
extern crate gio;
|
||||
extern crate libc;
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
extern crate hex;
|
||||
extern crate once_cell;
|
||||
extern crate radix64;
|
||||
extern crate thiserror;
|
||||
|
||||
// code generated by gir
|
||||
#[rustfmt::skip]
|
||||
#[allow(clippy::all)]
|
||||
|
@ -1,18 +1,17 @@
|
||||
use crate::ObjectType;
|
||||
use crate::{object_name_deserialize, object_name_serialize, object_to_string};
|
||||
use glib;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use glib_sys;
|
||||
use ostree_sys;
|
||||
use std::fmt::Display;
|
||||
use std::fmt::Error;
|
||||
use std::fmt::Formatter;
|
||||
use std::hash::Hash;
|
||||
use std::hash::Hasher;
|
||||
use ObjectType;
|
||||
|
||||
fn hash_object_name(v: &glib::Variant) -> u32 {
|
||||
unsafe { ostree_sys::ostree_hash_object_name(v.to_glib_none().0 as glib_sys::gconstpointer) }
|
||||
unsafe { ffi::ostree_hash_object_name(v.to_glib_none().0 as glib_sys::gconstpointer) }
|
||||
}
|
||||
|
||||
/// A reference to an object in an OSTree repo. It contains both a checksum and an
|
||||
|
@ -1,10 +1,10 @@
|
||||
#[cfg(any(feature = "v2016_4", feature = "dox"))]
|
||||
use crate::RepoListRefsExtFlags;
|
||||
use crate::{Checksum, ObjectName, ObjectType, Repo};
|
||||
use ffi;
|
||||
use gio_sys;
|
||||
use glib::{self, translate::*, Error, IsA};
|
||||
use glib_sys;
|
||||
use ostree_sys;
|
||||
use std::{
|
||||
collections::{HashMap, HashSet},
|
||||
future::Future,
|
||||
@ -38,7 +38,7 @@ unsafe fn from_glib_container_variant_set(ptr: *mut glib_sys::GHashTable) -> Has
|
||||
impl Repo {
|
||||
/// Create a new `Repo` object for working with an OSTree repo at the given path.
|
||||
pub fn new_for_path<P: AsRef<Path>>(path: P) -> Repo {
|
||||
Repo::new(&gio::File::new_for_path(path.as_ref()))
|
||||
Repo::new(&gio::File::for_path(path.as_ref()))
|
||||
}
|
||||
|
||||
pub fn traverse_commit<P: IsA<gio::Cancellable>>(
|
||||
@ -50,7 +50,7 @@ impl Repo {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let mut hashtable = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_repo_traverse_commit(
|
||||
let _ = ffi::ostree_repo_traverse_commit(
|
||||
self.to_glib_none().0,
|
||||
commit_checksum.to_glib_none().0,
|
||||
maxdepth,
|
||||
@ -74,7 +74,7 @@ impl Repo {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let mut hashtable = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_repo_list_refs(
|
||||
let _ = ffi::ostree_repo_list_refs(
|
||||
self.to_glib_none().0,
|
||||
refspec_prefix.to_glib_none().0,
|
||||
&mut hashtable,
|
||||
@ -100,11 +100,11 @@ impl Repo {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let mut hashtable = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_repo_list_refs_ext(
|
||||
let _ = ffi::ostree_repo_list_refs_ext(
|
||||
self.to_glib_none().0,
|
||||
refspec_prefix.to_glib_none().0,
|
||||
&mut hashtable,
|
||||
flags.to_glib(),
|
||||
flags.into_glib(),
|
||||
cancellable.map(AsRef::as_ref).to_glib_none().0,
|
||||
&mut error,
|
||||
);
|
||||
@ -127,7 +127,7 @@ impl Repo {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let mut out_csum = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_repo_write_content(
|
||||
let _ = ffi::ostree_repo_write_content(
|
||||
self.to_glib_none().0,
|
||||
expected_checksum.to_glib_none().0,
|
||||
object_input.as_ref().to_glib_none().0,
|
||||
@ -154,9 +154,9 @@ impl Repo {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let mut out_csum = ptr::null_mut();
|
||||
let _ = ostree_sys::ostree_repo_write_metadata(
|
||||
let _ = ffi::ostree_repo_write_metadata(
|
||||
self.to_glib_none().0,
|
||||
objtype.to_glib(),
|
||||
objtype.into_glib(),
|
||||
expected_checksum.to_glib_none().0,
|
||||
object.to_glib_none().0,
|
||||
&mut out_csum,
|
||||
@ -193,7 +193,7 @@ impl Repo {
|
||||
) {
|
||||
let mut error = ptr::null_mut();
|
||||
let mut out_csum = MaybeUninit::uninit();
|
||||
let _ = ostree_sys::ostree_repo_write_content_finish(
|
||||
let _ = ffi::ostree_repo_write_content_finish(
|
||||
_source_object as *mut _,
|
||||
res,
|
||||
out_csum.as_mut_ptr(),
|
||||
@ -210,7 +210,7 @@ impl Repo {
|
||||
}
|
||||
let callback = write_content_async_trampoline::<R>;
|
||||
unsafe {
|
||||
ostree_sys::ostree_repo_write_content_async(
|
||||
ffi::ostree_repo_write_content_async(
|
||||
self.to_glib_none().0,
|
||||
expected_checksum.to_glib_none().0,
|
||||
object.as_ref().to_glib_none().0,
|
||||
@ -230,20 +230,18 @@ impl Repo {
|
||||
) -> Pin<Box<dyn Future<Output = Result<Checksum, Error>> + 'static>> {
|
||||
let expected_checksum = expected_checksum.map(ToOwned::to_owned);
|
||||
let object = object.clone();
|
||||
Box::pin(gio::GioFuture::new(self, move |obj, send| {
|
||||
let cancellable = gio::Cancellable::new();
|
||||
Box::pin(gio::GioFuture::new(self, move |obj, cancellable, send| {
|
||||
obj.write_content_async(
|
||||
expected_checksum
|
||||
.as_ref()
|
||||
.map(::std::borrow::Borrow::borrow),
|
||||
&object,
|
||||
length,
|
||||
Some(&cancellable),
|
||||
Some(cancellable),
|
||||
move |res| {
|
||||
send.resolve(res);
|
||||
},
|
||||
);
|
||||
cancellable
|
||||
}))
|
||||
}
|
||||
|
||||
@ -268,7 +266,7 @@ impl Repo {
|
||||
) {
|
||||
let mut error = ptr::null_mut();
|
||||
let mut out_csum = MaybeUninit::uninit();
|
||||
let _ = ostree_sys::ostree_repo_write_metadata_finish(
|
||||
let _ = ffi::ostree_repo_write_metadata_finish(
|
||||
_source_object as *mut _,
|
||||
res,
|
||||
out_csum.as_mut_ptr(),
|
||||
@ -285,9 +283,9 @@ impl Repo {
|
||||
}
|
||||
let callback = write_metadata_async_trampoline::<Q>;
|
||||
unsafe {
|
||||
ostree_sys::ostree_repo_write_metadata_async(
|
||||
ffi::ostree_repo_write_metadata_async(
|
||||
self.to_glib_none().0,
|
||||
objtype.to_glib(),
|
||||
objtype.into_glib(),
|
||||
expected_checksum.to_glib_none().0,
|
||||
object.to_glib_none().0,
|
||||
cancellable.map(|p| p.as_ref()).to_glib_none().0,
|
||||
@ -305,20 +303,18 @@ impl Repo {
|
||||
) -> Pin<Box<dyn Future<Output = Result<Checksum, Error>> + 'static>> {
|
||||
let expected_checksum = expected_checksum.map(ToOwned::to_owned);
|
||||
let object = object.clone();
|
||||
Box::pin(gio::GioFuture::new(self, move |obj, send| {
|
||||
let cancellable = gio::Cancellable::new();
|
||||
Box::pin(gio::GioFuture::new(self, move |obj, cancellable, send| {
|
||||
obj.write_metadata_async(
|
||||
objtype,
|
||||
expected_checksum
|
||||
.as_ref()
|
||||
.map(::std::borrow::Borrow::borrow),
|
||||
&object,
|
||||
Some(&cancellable),
|
||||
Some(cancellable),
|
||||
move |res| {
|
||||
send.resolve(res);
|
||||
},
|
||||
);
|
||||
cancellable
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
use crate::{RepoCheckoutMode, RepoCheckoutOverwriteMode, RepoDevInoCache, SePolicy};
|
||||
use glib::translate::*;
|
||||
use libc::c_char;
|
||||
use ostree_sys::*;
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[cfg(any(feature = "v2018_2", feature = "dox"))]
|
||||
@ -69,45 +68,46 @@ impl Default for RepoCheckoutAtOptions {
|
||||
type StringStash<'a, T> = Stash<'a, *const c_char, Option<T>>;
|
||||
type WrapperStash<'a, GlibT, WrappedT> = Stash<'a, *mut GlibT, Option<WrappedT>>;
|
||||
|
||||
impl<'a> ToGlibPtr<'a, *const OstreeRepoCheckoutAtOptions> for RepoCheckoutAtOptions {
|
||||
impl<'a> ToGlibPtr<'a, *const ffi::OstreeRepoCheckoutAtOptions> for RepoCheckoutAtOptions {
|
||||
#[allow(clippy::type_complexity)]
|
||||
type Storage = (
|
||||
Box<OstreeRepoCheckoutAtOptions>,
|
||||
Box<ffi::OstreeRepoCheckoutAtOptions>,
|
||||
StringStash<'a, PathBuf>,
|
||||
StringStash<'a, String>,
|
||||
WrapperStash<'a, OstreeRepoDevInoCache, RepoDevInoCache>,
|
||||
WrapperStash<'a, OstreeSePolicy, SePolicy>,
|
||||
WrapperStash<'a, ffi::OstreeRepoDevInoCache, RepoDevInoCache>,
|
||||
WrapperStash<'a, ffi::OstreeSePolicy, SePolicy>,
|
||||
);
|
||||
|
||||
// We need to make sure that all memory pointed to by the returned pointer is kept alive by
|
||||
// either the `self` reference or the returned Stash.
|
||||
fn to_glib_none(&'a self) -> Stash<*const OstreeRepoCheckoutAtOptions, Self> {
|
||||
fn to_glib_none(&'a self) -> Stash<*const ffi::OstreeRepoCheckoutAtOptions, Self> {
|
||||
// Creating this struct from zeroed memory is fine since it's `repr(C)` and only contains
|
||||
// primitive types. In fact, the libostree docs say to zero the struct. This means we handle
|
||||
// the unused bytes correctly.
|
||||
// The struct needs to be boxed so the pointer we return remains valid even as the Stash is
|
||||
// moved around.
|
||||
let mut options = Box::new(unsafe { std::mem::zeroed::<OstreeRepoCheckoutAtOptions>() });
|
||||
options.mode = self.mode.to_glib();
|
||||
options.overwrite_mode = self.overwrite_mode.to_glib();
|
||||
options.enable_uncompressed_cache = self.enable_uncompressed_cache.to_glib();
|
||||
options.enable_fsync = self.enable_fsync.to_glib();
|
||||
options.process_whiteouts = self.process_whiteouts.to_glib();
|
||||
options.no_copy_fallback = self.no_copy_fallback.to_glib();
|
||||
let mut options =
|
||||
Box::new(unsafe { std::mem::zeroed::<ffi::OstreeRepoCheckoutAtOptions>() });
|
||||
options.mode = self.mode.into_glib();
|
||||
options.overwrite_mode = self.overwrite_mode.into_glib();
|
||||
options.enable_uncompressed_cache = self.enable_uncompressed_cache.into_glib();
|
||||
options.enable_fsync = self.enable_fsync.into_glib();
|
||||
options.process_whiteouts = self.process_whiteouts.into_glib();
|
||||
options.no_copy_fallback = self.no_copy_fallback.into_glib();
|
||||
|
||||
#[cfg(feature = "v2017_6")]
|
||||
{
|
||||
options.force_copy = self.force_copy.to_glib();
|
||||
options.force_copy = self.force_copy.into_glib();
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2017_7")]
|
||||
{
|
||||
options.bareuseronly_dirs = self.bareuseronly_dirs.to_glib();
|
||||
options.bareuseronly_dirs = self.bareuseronly_dirs.into_glib();
|
||||
}
|
||||
|
||||
#[cfg(feature = "v2018_9")]
|
||||
{
|
||||
options.force_copy_zerosized = self.force_copy_zerosized.to_glib();
|
||||
options.force_copy_zerosized = self.force_copy_zerosized.into_glib();
|
||||
}
|
||||
|
||||
// We keep these complex values alive by returning them in our Stash. Technically, some of
|
||||
@ -162,8 +162,11 @@ mod tests {
|
||||
let stash = options.to_glib_none();
|
||||
let ptr = stash.0;
|
||||
unsafe {
|
||||
assert_eq!((*ptr).mode, OSTREE_REPO_CHECKOUT_MODE_NONE);
|
||||
assert_eq!((*ptr).overwrite_mode, OSTREE_REPO_CHECKOUT_OVERWRITE_NONE);
|
||||
assert_eq!((*ptr).mode, ffi::OSTREE_REPO_CHECKOUT_MODE_NONE);
|
||||
assert_eq!(
|
||||
(*ptr).overwrite_mode,
|
||||
ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_NONE
|
||||
);
|
||||
assert_eq!((*ptr).enable_uncompressed_cache, GFALSE);
|
||||
assert_eq!((*ptr).enable_fsync, GFALSE);
|
||||
assert_eq!((*ptr).process_whiteouts, GFALSE);
|
||||
@ -212,17 +215,17 @@ mod tests {
|
||||
}),
|
||||
#[cfg(feature = "v2017_6")]
|
||||
sepolicy: Some(
|
||||
SePolicy::new(&gio::File::new_for_path("a/b"), gio::NONE_CANCELLABLE).unwrap(),
|
||||
SePolicy::new(&gio::File::for_path("a/b"), gio::NONE_CANCELLABLE).unwrap(),
|
||||
),
|
||||
sepolicy_prefix: Some("prefix".into()),
|
||||
};
|
||||
let stash = options.to_glib_none();
|
||||
let ptr = stash.0;
|
||||
unsafe {
|
||||
assert_eq!((*ptr).mode, OSTREE_REPO_CHECKOUT_MODE_USER);
|
||||
assert_eq!((*ptr).mode, ffi::OSTREE_REPO_CHECKOUT_MODE_USER);
|
||||
assert_eq!(
|
||||
(*ptr).overwrite_mode,
|
||||
OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL
|
||||
ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL
|
||||
);
|
||||
assert_eq!((*ptr).enable_uncompressed_cache, GTRUE);
|
||||
assert_eq!((*ptr).enable_fsync, GTRUE);
|
||||
|
@ -2,7 +2,6 @@ use crate::{Repo, RepoCheckoutFilterResult};
|
||||
use glib::translate::*;
|
||||
use glib_sys::gpointer;
|
||||
use libc::c_char;
|
||||
use ostree_sys::*;
|
||||
use std::any::Any;
|
||||
use std::panic::catch_unwind;
|
||||
use std::path::{Path, PathBuf};
|
||||
@ -65,11 +64,11 @@ impl FromGlibPtrNone<gpointer> for &RepoCheckoutFilter {
|
||||
/// # Panics
|
||||
/// If any parameter is a null pointer, the function panics.
|
||||
unsafe fn filter_trampoline(
|
||||
repo: *mut OstreeRepo,
|
||||
repo: *mut ffi::OstreeRepo,
|
||||
path: *const c_char,
|
||||
stat: *mut libc::stat,
|
||||
user_data: gpointer,
|
||||
) -> OstreeRepoCheckoutFilterResult {
|
||||
) -> ffi::OstreeRepoCheckoutFilterResult {
|
||||
// We can't guarantee it's a valid pointer, but we can make sure it's not null.
|
||||
assert!(!stat.is_null());
|
||||
let stat = &*stat;
|
||||
@ -83,17 +82,17 @@ unsafe fn filter_trampoline(
|
||||
let path: PathBuf = from_glib_none(path);
|
||||
|
||||
let result = closure.call(&repo, &path, stat);
|
||||
result.to_glib()
|
||||
result.into_glib()
|
||||
}
|
||||
|
||||
/// Unwind-safe trampoline to call the Rust filter callback. See [filter_trampoline](fn.filter_trampoline.html).
|
||||
/// This function additionally catches panics and aborts to avoid unwinding into C code.
|
||||
pub(super) unsafe extern "C" fn filter_trampoline_unwindsafe(
|
||||
repo: *mut OstreeRepo,
|
||||
repo: *mut ffi::OstreeRepo,
|
||||
path: *const c_char,
|
||||
stat: *mut libc::stat,
|
||||
user_data: gpointer,
|
||||
) -> OstreeRepoCheckoutFilterResult {
|
||||
) -> ffi::OstreeRepoCheckoutFilterResult {
|
||||
// Unwinding across an FFI boundary is Undefined Behavior and we have no other way to communicate
|
||||
// the error. We abort() safely to avoid further problems.
|
||||
let result = catch_unwind(move || filter_trampoline(repo, path, stat, user_data));
|
||||
@ -213,6 +212,6 @@ mod tests {
|
||||
filter.to_glib_none().0,
|
||||
)
|
||||
};
|
||||
assert_eq!(result, OSTREE_REPO_CHECKOUT_FILTER_SKIP);
|
||||
assert_eq!(result, ffi::OSTREE_REPO_CHECKOUT_FILTER_SKIP);
|
||||
}
|
||||
}
|
||||
|
@ -1,17 +1,16 @@
|
||||
use gobject_sys;
|
||||
use ostree_sys;
|
||||
|
||||
glib_wrapper! {
|
||||
glib::wrapper! {
|
||||
/// A list of statistics for each transaction that may be interesting for reporting purposes.
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct RepoTransactionStats(Boxed<ostree_sys::OstreeRepoTransactionStats>);
|
||||
pub struct RepoTransactionStats(Boxed<ffi::OstreeRepoTransactionStats>);
|
||||
|
||||
match fn {
|
||||
copy => |ptr| gobject_sys::g_boxed_copy(ostree_sys::ostree_repo_transaction_stats_get_type(), ptr as *mut _) as *mut ostree_sys::OstreeRepoTransactionStats,
|
||||
free => |ptr| gobject_sys::g_boxed_free(ostree_sys::ostree_repo_transaction_stats_get_type(), ptr as *mut _),
|
||||
copy => |ptr| gobject_sys::g_boxed_copy(ffi::ostree_repo_transaction_stats_get_type(), ptr as *mut _) as *mut ffi::OstreeRepoTransactionStats,
|
||||
free => |ptr| gobject_sys::g_boxed_free(ffi::ostree_repo_transaction_stats_get_type(), ptr as *mut _),
|
||||
init => |_ptr| (),
|
||||
clear => |_ptr| (),
|
||||
get_type => || ostree_sys::ostree_repo_transaction_stats_get_type(),
|
||||
type_ => || ffi::ostree_repo_transaction_stats_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,7 +4,7 @@ use std::ptr;
|
||||
impl SePolicy {
|
||||
pub fn fscreatecon_cleanup() {
|
||||
unsafe {
|
||||
ostree_sys::ostree_sepolicy_fscreatecon_cleanup(ptr::null_mut());
|
||||
ffi::ostree_sepolicy_fscreatecon_cleanup(ptr::null_mut());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
use ffi::OstreeSysrootDeployTreeOpts;
|
||||
use glib::translate::*;
|
||||
use libc::c_char;
|
||||
use ostree_sys::OstreeSysrootDeployTreeOpts;
|
||||
|
||||
pub struct SysrootDeployTreeOpts<'a> {
|
||||
pub override_kernel_argv: Option<&'a [&'a str]>,
|
||||
|
@ -1,5 +1,5 @@
|
||||
use ffi::OstreeSysrootWriteDeploymentsOpts;
|
||||
use glib::translate::*;
|
||||
use ostree_sys::OstreeSysrootWriteDeploymentsOpts;
|
||||
|
||||
pub struct SysrootWriteDeploymentsOpts {
|
||||
pub do_postclean: bool,
|
||||
@ -23,7 +23,7 @@ impl<'a> ToGlibPtr<'a, *const OstreeSysrootWriteDeploymentsOpts> for SysrootWrit
|
||||
// moved around.
|
||||
let mut options =
|
||||
Box::new(unsafe { std::mem::zeroed::<OstreeSysrootWriteDeploymentsOpts>() });
|
||||
options.do_postclean = self.do_postclean.to_glib();
|
||||
options.do_postclean = self.do_postclean.into_glib();
|
||||
Stash(options.as_ref(), options)
|
||||
}
|
||||
}
|
||||
|
@ -2,12 +2,12 @@
|
||||
repository = "fkrull/ostree-rs"
|
||||
|
||||
[build-dependencies]
|
||||
system-deps = "1.3"
|
||||
system-deps = "3"
|
||||
|
||||
[dependencies]
|
||||
gio-sys = "0.10.0"
|
||||
glib-sys = "0.10.0"
|
||||
gobject-sys = "0.10.0"
|
||||
glib-sys = "0.14.0"
|
||||
gobject-sys = "0.14.0"
|
||||
gio-sys = "0.14.0"
|
||||
libc = "0.2"
|
||||
|
||||
[dev-dependencies]
|
||||
@ -71,49 +71,126 @@ links = "ostree-1"
|
||||
name = "ostree-sys"
|
||||
repository = "https://gitlab.com/fkrull/ostree-rs"
|
||||
version = "0.7.3"
|
||||
edition = "2018"
|
||||
[package.metadata.docs.rs]
|
||||
features = ["dox"]
|
||||
[package.metadata.system-deps.ostree_1]
|
||||
name = "ostree-1"
|
||||
version = "0.0"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.feature-versions]
|
||||
v2014_9 = "2014.9"
|
||||
v2015_7 = "2015.7"
|
||||
v2016_3 = "2016.3"
|
||||
v2016_4 = "2016.4"
|
||||
v2016_5 = "2016.5"
|
||||
v2016_6 = "2016.6"
|
||||
v2016_7 = "2016.7"
|
||||
v2016_8 = "2016.8"
|
||||
v2016_14 = "2016.14"
|
||||
v2017_1 = "2017.1"
|
||||
v2017_2 = "2017.2"
|
||||
v2017_3 = "2017.3"
|
||||
v2017_4 = "2017.4"
|
||||
v2017_6 = "2017.6"
|
||||
v2017_7 = "2017.7"
|
||||
v2017_8 = "2017.8"
|
||||
v2017_9 = "2017.9"
|
||||
v2017_10 = "2017.10"
|
||||
v2017_11 = "2017.11"
|
||||
v2017_12 = "2017.12"
|
||||
v2017_13 = "2017.13"
|
||||
v2017_15 = "2017.15"
|
||||
v2018_2 = "2018.2"
|
||||
v2018_3 = "2018.3"
|
||||
v2018_5 = "2018.5"
|
||||
v2018_6 = "2018.6"
|
||||
v2018_7 = "2018.7"
|
||||
v2018_9 = "2018.9"
|
||||
v2019_2 = "2019.2"
|
||||
v2019_3 = "2019.3"
|
||||
v2019_4 = "2019.4"
|
||||
v2019_6 = "2019.6"
|
||||
v2020_1 = "2020.1"
|
||||
v2020_2 = "2020.2"
|
||||
v2020_4 = "2020.4"
|
||||
v2020_7 = "2020.7"
|
||||
v2020_8 = "2020.8"
|
||||
v2021_1 = "2021.1"
|
||||
v2021_2 = "2021.2"
|
||||
[package.metadata.system-deps.ostree_1.v2014_9]
|
||||
version = "2014.9"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2015_7]
|
||||
version = "2015.7"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2016_3]
|
||||
version = "2016.3"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2016_4]
|
||||
version = "2016.4"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2016_5]
|
||||
version = "2016.5"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2016_6]
|
||||
version = "2016.6"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2016_7]
|
||||
version = "2016.7"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2016_8]
|
||||
version = "2016.8"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2016_14]
|
||||
version = "2016.14"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2017_1]
|
||||
version = "2017.1"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2017_2]
|
||||
version = "2017.2"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2017_3]
|
||||
version = "2017.3"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2017_4]
|
||||
version = "2017.4"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2017_6]
|
||||
version = "2017.6"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2017_7]
|
||||
version = "2017.7"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2017_8]
|
||||
version = "2017.8"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2017_9]
|
||||
version = "2017.9"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2017_10]
|
||||
version = "2017.10"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2017_11]
|
||||
version = "2017.11"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2017_12]
|
||||
version = "2017.12"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2017_13]
|
||||
version = "2017.13"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2017_15]
|
||||
version = "2017.15"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2018_2]
|
||||
version = "2018.2"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2018_3]
|
||||
version = "2018.3"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2018_5]
|
||||
version = "2018.5"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2018_6]
|
||||
version = "2018.6"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2018_7]
|
||||
version = "2018.7"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2018_9]
|
||||
version = "2018.9"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2019_2]
|
||||
version = "2019.2"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2019_3]
|
||||
version = "2019.3"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2019_4]
|
||||
version = "2019.4"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2019_6]
|
||||
version = "2019.6"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2020_1]
|
||||
version = "2020.1"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2020_2]
|
||||
version = "2020.2"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2020_4]
|
||||
version = "2020.4"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2020_7]
|
||||
version = "2020.7"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2020_8]
|
||||
version = "2020.8"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2021_1]
|
||||
version = "2021.1"
|
||||
|
||||
[package.metadata.system-deps.ostree_1.v2021_2]
|
||||
version = "2021.2"
|
||||
|
@ -1,10 +1,7 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(not(feature = "dox"))]
|
||||
extern crate system_deps;
|
||||
|
||||
#[cfg(not(feature = "dox"))]
|
||||
use std::process;
|
||||
|
||||
@ -14,7 +11,7 @@ fn main() {} // prevent linking libraries to avoid documentation failure
|
||||
#[cfg(not(feature = "dox"))]
|
||||
fn main() {
|
||||
if let Err(s) = system_deps::Config::new().probe() {
|
||||
let _ = eprintln!("{}", s);
|
||||
println!("cargo:warning={}", s);
|
||||
process::exit(1);
|
||||
}
|
||||
}
|
||||
|
@ -1,2 +1,2 @@
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 2d1ffab)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ e4bcf9b+)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ e8f82cf6)
|
||||
from gir-files
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,18 +1,16 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
extern crate ostree_sys;
|
||||
extern crate shell_words;
|
||||
extern crate tempfile;
|
||||
use ostree_sys::*;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::ffi::OsString;
|
||||
use std::mem::{align_of, size_of};
|
||||
use std::path::Path;
|
||||
use std::process::Command;
|
||||
use std::str;
|
||||
use tempfile::Builder;
|
||||
use ostree_sys::*;
|
||||
|
||||
static PACKAGES: &[&str] = &["ostree-1"];
|
||||
|
||||
@ -22,23 +20,17 @@ struct Compiler {
|
||||
}
|
||||
|
||||
impl Compiler {
|
||||
pub fn new() -> Result<Compiler, Box<dyn Error>> {
|
||||
pub fn new() -> Result<Self, Box<dyn Error>> {
|
||||
let mut args = get_var("CC", "cc")?;
|
||||
args.push("-Wno-deprecated-declarations".to_owned());
|
||||
// For _Generic
|
||||
args.push("-std=c11".to_owned());
|
||||
// For %z support in printf when using MinGW.
|
||||
args.push("-D__USE_MINGW_ANSI_STDIO".to_owned());
|
||||
args.extend(get_var("CFLAGS", "")?);
|
||||
args.extend(get_var("CPPFLAGS", "")?);
|
||||
args.extend(pkg_config_cflags(PACKAGES)?);
|
||||
Ok(Compiler { args })
|
||||
}
|
||||
|
||||
pub fn define<'a, V: Into<Option<&'a str>>>(&mut self, var: &str, val: V) {
|
||||
let arg = match val.into() {
|
||||
None => format!("-D{}", var),
|
||||
Some(val) => format!("-D{}={}", var, val),
|
||||
};
|
||||
self.args.push(arg);
|
||||
Ok(Self { args })
|
||||
}
|
||||
|
||||
pub fn compile(&self, src: &Path, out: &Path) -> Result<(), Box<dyn Error>> {
|
||||
@ -48,8 +40,7 @@ impl Compiler {
|
||||
cmd.arg(out);
|
||||
let status = cmd.spawn()?.wait()?;
|
||||
if !status.success() {
|
||||
return Err(format!("compilation command {:?} failed, {}",
|
||||
&cmd, status).into());
|
||||
return Err(format!("compilation command {:?} failed, {}", &cmd, status).into());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@ -73,19 +64,18 @@ fn pkg_config_cflags(packages: &[&str]) -> Result<Vec<String>, Box<dyn Error>> {
|
||||
if packages.is_empty() {
|
||||
return Ok(Vec::new());
|
||||
}
|
||||
let mut cmd = Command::new("pkg-config");
|
||||
let pkg_config = env::var_os("PKG_CONFIG").unwrap_or_else(|| OsString::from("pkg-config"));
|
||||
let mut cmd = Command::new(pkg_config);
|
||||
cmd.arg("--cflags");
|
||||
cmd.args(packages);
|
||||
let out = cmd.output()?;
|
||||
if !out.status.success() {
|
||||
return Err(format!("command {:?} returned {}",
|
||||
&cmd, out.status).into());
|
||||
return Err(format!("command {:?} returned {}", &cmd, out.status).into());
|
||||
}
|
||||
let stdout = str::from_utf8(&out.stdout)?;
|
||||
Ok(shell_words::split(stdout.trim())?)
|
||||
}
|
||||
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||
struct Layout {
|
||||
size: usize,
|
||||
@ -98,8 +88,6 @@ struct Results {
|
||||
passed: usize,
|
||||
/// Total number of failed tests (including those that failed to compile).
|
||||
failed: usize,
|
||||
/// Number of tests that failed to compile.
|
||||
failed_to_compile: usize,
|
||||
}
|
||||
|
||||
impl Results {
|
||||
@ -109,16 +97,8 @@ impl Results {
|
||||
fn record_failed(&mut self) {
|
||||
self.failed += 1;
|
||||
}
|
||||
fn record_failed_to_compile(&mut self) {
|
||||
self.failed += 1;
|
||||
self.failed_to_compile += 1;
|
||||
}
|
||||
fn summary(&self) -> String {
|
||||
format!(
|
||||
"{} passed; {} failed (compilation errors: {})",
|
||||
self.passed,
|
||||
self.failed,
|
||||
self.failed_to_compile)
|
||||
format!("{} passed; {} failed", self.passed, self.failed)
|
||||
}
|
||||
fn expect_total_success(&self) {
|
||||
if self.failed == 0 {
|
||||
@ -131,166 +111,469 @@ impl Results {
|
||||
|
||||
#[test]
|
||||
fn cross_validate_constants_with_c() {
|
||||
let tmpdir = Builder::new().prefix("abi").tempdir().expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
let mut c_constants: Vec<(String, String)> = Vec::new();
|
||||
|
||||
assert_eq!("1",
|
||||
get_c_value(tmpdir.path(), &cc, "1").expect("C constant"),
|
||||
"failed to obtain correct constant value for 1");
|
||||
|
||||
let mut results : Results = Default::default();
|
||||
for (i, &(name, rust_value)) in RUST_CONSTANTS.iter().enumerate() {
|
||||
match get_c_value(tmpdir.path(), &cc, name) {
|
||||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
Ok(ref c_value) => {
|
||||
if rust_value == c_value {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_value, c_value);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (i + 1) % 25 == 0 {
|
||||
println!("constants ... {}", results.summary());
|
||||
}
|
||||
for l in get_c_output("constant").unwrap().lines() {
|
||||
let mut words = l.trim().split(';');
|
||||
let name = words.next().expect("Failed to parse name").to_owned();
|
||||
let value = words
|
||||
.next()
|
||||
.and_then(|s| s.parse().ok())
|
||||
.expect("Failed to parse value");
|
||||
c_constants.push((name, value));
|
||||
}
|
||||
|
||||
let mut results = Results::default();
|
||||
|
||||
for ((rust_name, rust_value), (c_name, c_value)) in
|
||||
RUST_CONSTANTS.iter().zip(c_constants.iter())
|
||||
{
|
||||
if rust_name != c_name {
|
||||
results.record_failed();
|
||||
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
|
||||
continue;
|
||||
}
|
||||
|
||||
if rust_value != c_value {
|
||||
results.record_failed();
|
||||
eprintln!(
|
||||
"Constant value mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
rust_name, rust_value, &c_value
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
results.record_passed();
|
||||
}
|
||||
|
||||
results.expect_total_success();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn cross_validate_layout_with_c() {
|
||||
let tmpdir = Builder::new().prefix("abi").tempdir().expect("temporary directory");
|
||||
let cc = Compiler::new().expect("configured compiler");
|
||||
let mut c_layouts = Vec::new();
|
||||
|
||||
assert_eq!(Layout {size: 1, alignment: 1},
|
||||
get_c_layout(tmpdir.path(), &cc, "char").expect("C layout"),
|
||||
"failed to obtain correct layout for char type");
|
||||
|
||||
let mut results : Results = Default::default();
|
||||
for (i, &(name, rust_layout)) in RUST_LAYOUTS.iter().enumerate() {
|
||||
match get_c_layout(tmpdir.path(), &cc, name) {
|
||||
Err(e) => {
|
||||
results.record_failed_to_compile();
|
||||
eprintln!("{}", e);
|
||||
},
|
||||
Ok(c_layout) => {
|
||||
if rust_layout == c_layout {
|
||||
results.record_passed();
|
||||
} else {
|
||||
results.record_failed();
|
||||
eprintln!("Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
name, rust_layout, &c_layout);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (i + 1) % 25 == 0 {
|
||||
println!("layout ... {}", results.summary());
|
||||
}
|
||||
for l in get_c_output("layout").unwrap().lines() {
|
||||
let mut words = l.trim().split(';');
|
||||
let name = words.next().expect("Failed to parse name").to_owned();
|
||||
let size = words
|
||||
.next()
|
||||
.and_then(|s| s.parse().ok())
|
||||
.expect("Failed to parse size");
|
||||
let alignment = words
|
||||
.next()
|
||||
.and_then(|s| s.parse().ok())
|
||||
.expect("Failed to parse alignment");
|
||||
c_layouts.push((name, Layout { size, alignment }));
|
||||
}
|
||||
|
||||
let mut results = Results::default();
|
||||
|
||||
for ((rust_name, rust_layout), (c_name, c_layout)) in RUST_LAYOUTS.iter().zip(c_layouts.iter())
|
||||
{
|
||||
if rust_name != c_name {
|
||||
results.record_failed();
|
||||
eprintln!("Name mismatch:\nRust: {:?}\nC: {:?}", rust_name, c_name,);
|
||||
continue;
|
||||
}
|
||||
|
||||
if rust_layout != c_layout {
|
||||
results.record_failed();
|
||||
eprintln!(
|
||||
"Layout mismatch for {}\nRust: {:?}\nC: {:?}",
|
||||
rust_name, rust_layout, &c_layout
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
results.record_passed();
|
||||
}
|
||||
|
||||
results.expect_total_success();
|
||||
}
|
||||
|
||||
fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<dyn Error>> {
|
||||
let exe = dir.join("layout");
|
||||
let mut cc = cc.clone();
|
||||
cc.define("ABI_TYPE_NAME", name);
|
||||
cc.compile(Path::new("tests/layout.c"), &exe)?;
|
||||
fn get_c_output(name: &str) -> Result<String, Box<dyn Error>> {
|
||||
let tmpdir = Builder::new().prefix("abi").tempdir()?;
|
||||
let exe = tmpdir.path().join(name);
|
||||
let c_file = Path::new("tests").join(name).with_extension("c");
|
||||
|
||||
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 {:?} failed, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
return Err(format!("command {:?} failed, {:?}", &abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let stdout = str::from_utf8(&output.stdout)?;
|
||||
let mut words = stdout.trim().split_whitespace();
|
||||
let size = words.next().unwrap().parse().unwrap();
|
||||
let alignment = words.next().unwrap().parse().unwrap();
|
||||
Ok(Layout {size, alignment})
|
||||
}
|
||||
|
||||
fn get_c_value(dir: &Path, cc: &Compiler, name: &str) -> Result<String, Box<dyn Error>> {
|
||||
let exe = dir.join("constant");
|
||||
let mut cc = cc.clone();
|
||||
cc.define("ABI_CONSTANT_NAME", name);
|
||||
cc.compile(Path::new("tests/constant.c"), &exe)?;
|
||||
|
||||
let mut abi_cmd = Command::new(exe);
|
||||
let output = abi_cmd.output()?;
|
||||
if !output.status.success() {
|
||||
return Err(format!("command {:?} failed, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
let output = str::from_utf8(&output.stdout)?.trim();
|
||||
if !output.starts_with("###gir test###") ||
|
||||
!output.ends_with("###gir test###") {
|
||||
return Err(format!("command {:?} return invalid output, {:?}",
|
||||
&abi_cmd, &output).into());
|
||||
}
|
||||
|
||||
Ok(String::from(&output[14..(output.len() - 14)]))
|
||||
Ok(String::from_utf8(output.stdout)?)
|
||||
}
|
||||
|
||||
const RUST_LAYOUTS: &[(&str, Layout)] = &[
|
||||
("OstreeAsyncProgressClass", Layout {size: size_of::<OstreeAsyncProgressClass>(), alignment: align_of::<OstreeAsyncProgressClass>()}),
|
||||
("OstreeChecksumFlags", Layout {size: size_of::<OstreeChecksumFlags>(), alignment: align_of::<OstreeChecksumFlags>()}),
|
||||
("OstreeCollectionRef", Layout {size: size_of::<OstreeCollectionRef>(), alignment: align_of::<OstreeCollectionRef>()}),
|
||||
("OstreeCollectionRefv", Layout {size: size_of::<OstreeCollectionRefv>(), alignment: align_of::<OstreeCollectionRefv>()}),
|
||||
("OstreeCommitSizesEntry", Layout {size: size_of::<OstreeCommitSizesEntry>(), alignment: align_of::<OstreeCommitSizesEntry>()}),
|
||||
("OstreeContentWriterClass", Layout {size: size_of::<OstreeContentWriterClass>(), alignment: align_of::<OstreeContentWriterClass>()}),
|
||||
("OstreeDeploymentUnlockedState", Layout {size: size_of::<OstreeDeploymentUnlockedState>(), alignment: align_of::<OstreeDeploymentUnlockedState>()}),
|
||||
("OstreeDiffDirsOptions", Layout {size: size_of::<OstreeDiffDirsOptions>(), alignment: align_of::<OstreeDiffDirsOptions>()}),
|
||||
("OstreeDiffFlags", Layout {size: size_of::<OstreeDiffFlags>(), alignment: align_of::<OstreeDiffFlags>()}),
|
||||
("OstreeDiffItem", Layout {size: size_of::<OstreeDiffItem>(), alignment: align_of::<OstreeDiffItem>()}),
|
||||
("OstreeGpgError", Layout {size: size_of::<OstreeGpgError>(), alignment: align_of::<OstreeGpgError>()}),
|
||||
("OstreeGpgSignatureAttr", Layout {size: size_of::<OstreeGpgSignatureAttr>(), alignment: align_of::<OstreeGpgSignatureAttr>()}),
|
||||
("OstreeGpgSignatureFormatFlags", Layout {size: size_of::<OstreeGpgSignatureFormatFlags>(), alignment: align_of::<OstreeGpgSignatureFormatFlags>()}),
|
||||
("OstreeMutableTreeClass", Layout {size: size_of::<OstreeMutableTreeClass>(), alignment: align_of::<OstreeMutableTreeClass>()}),
|
||||
("OstreeMutableTreeIter", Layout {size: size_of::<OstreeMutableTreeIter>(), alignment: align_of::<OstreeMutableTreeIter>()}),
|
||||
("OstreeObjectType", Layout {size: size_of::<OstreeObjectType>(), alignment: align_of::<OstreeObjectType>()}),
|
||||
("OstreeRepoCheckoutAtOptions", Layout {size: size_of::<OstreeRepoCheckoutAtOptions>(), alignment: align_of::<OstreeRepoCheckoutAtOptions>()}),
|
||||
("OstreeRepoCheckoutFilterResult", Layout {size: size_of::<OstreeRepoCheckoutFilterResult>(), alignment: align_of::<OstreeRepoCheckoutFilterResult>()}),
|
||||
("OstreeRepoCheckoutMode", Layout {size: size_of::<OstreeRepoCheckoutMode>(), alignment: align_of::<OstreeRepoCheckoutMode>()}),
|
||||
("OstreeRepoCheckoutOverwriteMode", Layout {size: size_of::<OstreeRepoCheckoutOverwriteMode>(), alignment: align_of::<OstreeRepoCheckoutOverwriteMode>()}),
|
||||
("OstreeRepoCommitFilterResult", Layout {size: size_of::<OstreeRepoCommitFilterResult>(), alignment: align_of::<OstreeRepoCommitFilterResult>()}),
|
||||
("OstreeRepoCommitIterResult", Layout {size: size_of::<OstreeRepoCommitIterResult>(), alignment: align_of::<OstreeRepoCommitIterResult>()}),
|
||||
("OstreeRepoCommitModifierFlags", Layout {size: size_of::<OstreeRepoCommitModifierFlags>(), alignment: align_of::<OstreeRepoCommitModifierFlags>()}),
|
||||
("OstreeRepoCommitState", Layout {size: size_of::<OstreeRepoCommitState>(), alignment: align_of::<OstreeRepoCommitState>()}),
|
||||
("OstreeRepoCommitTraverseFlags", Layout {size: size_of::<OstreeRepoCommitTraverseFlags>(), alignment: align_of::<OstreeRepoCommitTraverseFlags>()}),
|
||||
("OstreeRepoCommitTraverseIter", Layout {size: size_of::<OstreeRepoCommitTraverseIter>(), alignment: align_of::<OstreeRepoCommitTraverseIter>()}),
|
||||
("OstreeRepoFileClass", Layout {size: size_of::<OstreeRepoFileClass>(), alignment: align_of::<OstreeRepoFileClass>()}),
|
||||
("OstreeRepoFinderAvahiClass", Layout {size: size_of::<OstreeRepoFinderAvahiClass>(), alignment: align_of::<OstreeRepoFinderAvahiClass>()}),
|
||||
("OstreeRepoFinderConfigClass", Layout {size: size_of::<OstreeRepoFinderConfigClass>(), alignment: align_of::<OstreeRepoFinderConfigClass>()}),
|
||||
("OstreeRepoFinderInterface", Layout {size: size_of::<OstreeRepoFinderInterface>(), alignment: align_of::<OstreeRepoFinderInterface>()}),
|
||||
("OstreeRepoFinderMountClass", Layout {size: size_of::<OstreeRepoFinderMountClass>(), alignment: align_of::<OstreeRepoFinderMountClass>()}),
|
||||
("OstreeRepoFinderOverrideClass", Layout {size: size_of::<OstreeRepoFinderOverrideClass>(), alignment: align_of::<OstreeRepoFinderOverrideClass>()}),
|
||||
("OstreeRepoFinderResult", Layout {size: size_of::<OstreeRepoFinderResult>(), alignment: align_of::<OstreeRepoFinderResult>()}),
|
||||
("OstreeRepoFinderResultv", Layout {size: size_of::<OstreeRepoFinderResultv>(), alignment: align_of::<OstreeRepoFinderResultv>()}),
|
||||
("OstreeRepoListObjectsFlags", Layout {size: size_of::<OstreeRepoListObjectsFlags>(), alignment: align_of::<OstreeRepoListObjectsFlags>()}),
|
||||
("OstreeRepoListRefsExtFlags", Layout {size: size_of::<OstreeRepoListRefsExtFlags>(), alignment: align_of::<OstreeRepoListRefsExtFlags>()}),
|
||||
("OstreeRepoMode", Layout {size: size_of::<OstreeRepoMode>(), alignment: align_of::<OstreeRepoMode>()}),
|
||||
("OstreeRepoPruneFlags", Layout {size: size_of::<OstreeRepoPruneFlags>(), alignment: align_of::<OstreeRepoPruneFlags>()}),
|
||||
("OstreeRepoPruneOptions", Layout {size: size_of::<OstreeRepoPruneOptions>(), alignment: align_of::<OstreeRepoPruneOptions>()}),
|
||||
("OstreeRepoPullFlags", Layout {size: size_of::<OstreeRepoPullFlags>(), alignment: align_of::<OstreeRepoPullFlags>()}),
|
||||
("OstreeRepoRemoteChange", Layout {size: size_of::<OstreeRepoRemoteChange>(), alignment: align_of::<OstreeRepoRemoteChange>()}),
|
||||
("OstreeRepoResolveRevExtFlags", Layout {size: size_of::<OstreeRepoResolveRevExtFlags>(), alignment: align_of::<OstreeRepoResolveRevExtFlags>()}),
|
||||
("OstreeRepoTransactionStats", Layout {size: size_of::<OstreeRepoTransactionStats>(), alignment: align_of::<OstreeRepoTransactionStats>()}),
|
||||
("OstreeSePolicyRestoreconFlags", Layout {size: size_of::<OstreeSePolicyRestoreconFlags>(), alignment: align_of::<OstreeSePolicyRestoreconFlags>()}),
|
||||
("OstreeSignInterface", Layout {size: size_of::<OstreeSignInterface>(), alignment: align_of::<OstreeSignInterface>()}),
|
||||
("OstreeStaticDeltaGenerateOpt", Layout {size: size_of::<OstreeStaticDeltaGenerateOpt>(), alignment: align_of::<OstreeStaticDeltaGenerateOpt>()}),
|
||||
("OstreeStaticDeltaIndexFlags", Layout {size: size_of::<OstreeStaticDeltaIndexFlags>(), alignment: align_of::<OstreeStaticDeltaIndexFlags>()}),
|
||||
("OstreeSysrootDeployTreeOpts", Layout {size: size_of::<OstreeSysrootDeployTreeOpts>(), alignment: align_of::<OstreeSysrootDeployTreeOpts>()}),
|
||||
("OstreeSysrootSimpleWriteDeploymentFlags", Layout {size: size_of::<OstreeSysrootSimpleWriteDeploymentFlags>(), alignment: align_of::<OstreeSysrootSimpleWriteDeploymentFlags>()}),
|
||||
("OstreeSysrootUpgraderFlags", Layout {size: size_of::<OstreeSysrootUpgraderFlags>(), alignment: align_of::<OstreeSysrootUpgraderFlags>()}),
|
||||
("OstreeSysrootUpgraderPullFlags", Layout {size: size_of::<OstreeSysrootUpgraderPullFlags>(), alignment: align_of::<OstreeSysrootUpgraderPullFlags>()}),
|
||||
("OstreeSysrootWriteDeploymentsOpts", Layout {size: size_of::<OstreeSysrootWriteDeploymentsOpts>(), alignment: align_of::<OstreeSysrootWriteDeploymentsOpts>()}),
|
||||
(
|
||||
"OstreeAsyncProgressClass",
|
||||
Layout {
|
||||
size: size_of::<OstreeAsyncProgressClass>(),
|
||||
alignment: align_of::<OstreeAsyncProgressClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeChecksumFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeChecksumFlags>(),
|
||||
alignment: align_of::<OstreeChecksumFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeCollectionRef",
|
||||
Layout {
|
||||
size: size_of::<OstreeCollectionRef>(),
|
||||
alignment: align_of::<OstreeCollectionRef>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeCollectionRefv",
|
||||
Layout {
|
||||
size: size_of::<OstreeCollectionRefv>(),
|
||||
alignment: align_of::<OstreeCollectionRefv>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeCommitSizesEntry",
|
||||
Layout {
|
||||
size: size_of::<OstreeCommitSizesEntry>(),
|
||||
alignment: align_of::<OstreeCommitSizesEntry>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeContentWriterClass",
|
||||
Layout {
|
||||
size: size_of::<OstreeContentWriterClass>(),
|
||||
alignment: align_of::<OstreeContentWriterClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeDeploymentUnlockedState",
|
||||
Layout {
|
||||
size: size_of::<OstreeDeploymentUnlockedState>(),
|
||||
alignment: align_of::<OstreeDeploymentUnlockedState>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeDiffDirsOptions",
|
||||
Layout {
|
||||
size: size_of::<OstreeDiffDirsOptions>(),
|
||||
alignment: align_of::<OstreeDiffDirsOptions>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeDiffFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeDiffFlags>(),
|
||||
alignment: align_of::<OstreeDiffFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeDiffItem",
|
||||
Layout {
|
||||
size: size_of::<OstreeDiffItem>(),
|
||||
alignment: align_of::<OstreeDiffItem>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeGpgError",
|
||||
Layout {
|
||||
size: size_of::<OstreeGpgError>(),
|
||||
alignment: align_of::<OstreeGpgError>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeGpgSignatureAttr",
|
||||
Layout {
|
||||
size: size_of::<OstreeGpgSignatureAttr>(),
|
||||
alignment: align_of::<OstreeGpgSignatureAttr>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeGpgSignatureFormatFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeGpgSignatureFormatFlags>(),
|
||||
alignment: align_of::<OstreeGpgSignatureFormatFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeMutableTreeClass",
|
||||
Layout {
|
||||
size: size_of::<OstreeMutableTreeClass>(),
|
||||
alignment: align_of::<OstreeMutableTreeClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeMutableTreeIter",
|
||||
Layout {
|
||||
size: size_of::<OstreeMutableTreeIter>(),
|
||||
alignment: align_of::<OstreeMutableTreeIter>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeObjectType",
|
||||
Layout {
|
||||
size: size_of::<OstreeObjectType>(),
|
||||
alignment: align_of::<OstreeObjectType>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoCheckoutAtOptions",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoCheckoutAtOptions>(),
|
||||
alignment: align_of::<OstreeRepoCheckoutAtOptions>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoCheckoutFilterResult",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoCheckoutFilterResult>(),
|
||||
alignment: align_of::<OstreeRepoCheckoutFilterResult>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoCheckoutMode",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoCheckoutMode>(),
|
||||
alignment: align_of::<OstreeRepoCheckoutMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoCheckoutOverwriteMode",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoCheckoutOverwriteMode>(),
|
||||
alignment: align_of::<OstreeRepoCheckoutOverwriteMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoCommitFilterResult",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoCommitFilterResult>(),
|
||||
alignment: align_of::<OstreeRepoCommitFilterResult>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoCommitIterResult",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoCommitIterResult>(),
|
||||
alignment: align_of::<OstreeRepoCommitIterResult>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoCommitModifierFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoCommitModifierFlags>(),
|
||||
alignment: align_of::<OstreeRepoCommitModifierFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoCommitState",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoCommitState>(),
|
||||
alignment: align_of::<OstreeRepoCommitState>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoCommitTraverseFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoCommitTraverseFlags>(),
|
||||
alignment: align_of::<OstreeRepoCommitTraverseFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoCommitTraverseIter",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoCommitTraverseIter>(),
|
||||
alignment: align_of::<OstreeRepoCommitTraverseIter>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoFileClass",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoFileClass>(),
|
||||
alignment: align_of::<OstreeRepoFileClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoFinderAvahiClass",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoFinderAvahiClass>(),
|
||||
alignment: align_of::<OstreeRepoFinderAvahiClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoFinderConfigClass",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoFinderConfigClass>(),
|
||||
alignment: align_of::<OstreeRepoFinderConfigClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoFinderInterface",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoFinderInterface>(),
|
||||
alignment: align_of::<OstreeRepoFinderInterface>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoFinderMountClass",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoFinderMountClass>(),
|
||||
alignment: align_of::<OstreeRepoFinderMountClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoFinderOverrideClass",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoFinderOverrideClass>(),
|
||||
alignment: align_of::<OstreeRepoFinderOverrideClass>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoFinderResult",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoFinderResult>(),
|
||||
alignment: align_of::<OstreeRepoFinderResult>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoFinderResultv",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoFinderResultv>(),
|
||||
alignment: align_of::<OstreeRepoFinderResultv>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoListObjectsFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoListObjectsFlags>(),
|
||||
alignment: align_of::<OstreeRepoListObjectsFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoListRefsExtFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoListRefsExtFlags>(),
|
||||
alignment: align_of::<OstreeRepoListRefsExtFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoMode",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoMode>(),
|
||||
alignment: align_of::<OstreeRepoMode>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoPruneFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoPruneFlags>(),
|
||||
alignment: align_of::<OstreeRepoPruneFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoPruneOptions",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoPruneOptions>(),
|
||||
alignment: align_of::<OstreeRepoPruneOptions>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoPullFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoPullFlags>(),
|
||||
alignment: align_of::<OstreeRepoPullFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoRemoteChange",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoRemoteChange>(),
|
||||
alignment: align_of::<OstreeRepoRemoteChange>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoResolveRevExtFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoResolveRevExtFlags>(),
|
||||
alignment: align_of::<OstreeRepoResolveRevExtFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeRepoTransactionStats",
|
||||
Layout {
|
||||
size: size_of::<OstreeRepoTransactionStats>(),
|
||||
alignment: align_of::<OstreeRepoTransactionStats>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeSePolicyRestoreconFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeSePolicyRestoreconFlags>(),
|
||||
alignment: align_of::<OstreeSePolicyRestoreconFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeSignInterface",
|
||||
Layout {
|
||||
size: size_of::<OstreeSignInterface>(),
|
||||
alignment: align_of::<OstreeSignInterface>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeStaticDeltaGenerateOpt",
|
||||
Layout {
|
||||
size: size_of::<OstreeStaticDeltaGenerateOpt>(),
|
||||
alignment: align_of::<OstreeStaticDeltaGenerateOpt>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeStaticDeltaIndexFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeStaticDeltaIndexFlags>(),
|
||||
alignment: align_of::<OstreeStaticDeltaIndexFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeSysrootDeployTreeOpts",
|
||||
Layout {
|
||||
size: size_of::<OstreeSysrootDeployTreeOpts>(),
|
||||
alignment: align_of::<OstreeSysrootDeployTreeOpts>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeSysrootSimpleWriteDeploymentFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeSysrootSimpleWriteDeploymentFlags>(),
|
||||
alignment: align_of::<OstreeSysrootSimpleWriteDeploymentFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeSysrootUpgraderFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeSysrootUpgraderFlags>(),
|
||||
alignment: align_of::<OstreeSysrootUpgraderFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeSysrootUpgraderPullFlags",
|
||||
Layout {
|
||||
size: size_of::<OstreeSysrootUpgraderPullFlags>(),
|
||||
alignment: align_of::<OstreeSysrootUpgraderPullFlags>(),
|
||||
},
|
||||
),
|
||||
(
|
||||
"OstreeSysrootWriteDeploymentsOpts",
|
||||
Layout {
|
||||
size: size_of::<OstreeSysrootWriteDeploymentsOpts>(),
|
||||
alignment: align_of::<OstreeSysrootWriteDeploymentsOpts>(),
|
||||
},
|
||||
),
|
||||
];
|
||||
|
||||
const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
@ -298,9 +581,15 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
("(guint) OSTREE_CHECKSUM_FLAGS_NONE", "0"),
|
||||
("OSTREE_COMMIT_GVARIANT_STRING", "(a{sv}aya(say)sstayay)"),
|
||||
("OSTREE_COMMIT_META_KEY_ARCHITECTURE", "ostree.architecture"),
|
||||
("OSTREE_COMMIT_META_KEY_COLLECTION_BINDING", "ostree.collection-binding"),
|
||||
(
|
||||
"OSTREE_COMMIT_META_KEY_COLLECTION_BINDING",
|
||||
"ostree.collection-binding",
|
||||
),
|
||||
("OSTREE_COMMIT_META_KEY_ENDOFLIFE", "ostree.endoflife"),
|
||||
("OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE", "ostree.endoflife-rebase"),
|
||||
(
|
||||
"OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE",
|
||||
"ostree.endoflife-rebase",
|
||||
),
|
||||
("OSTREE_COMMIT_META_KEY_REF_BINDING", "ostree.ref-binding"),
|
||||
("OSTREE_COMMIT_META_KEY_SOURCE_TITLE", "ostree.source-title"),
|
||||
("OSTREE_COMMIT_META_KEY_VERSION", "version"),
|
||||
@ -324,7 +613,10 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
("(gint) OSTREE_GPG_SIGNATURE_ATTR_HASH_ALGO_NAME", "9"),
|
||||
("(gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_EXPIRED", "2"),
|
||||
("(gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP", "13"),
|
||||
("(gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP_PRIMARY", "14"),
|
||||
(
|
||||
"(gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP_PRIMARY",
|
||||
"14",
|
||||
),
|
||||
("(gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_MISSING", "4"),
|
||||
("(gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_REVOKED", "3"),
|
||||
("(gint) OSTREE_GPG_SIGNATURE_ATTR_PUBKEY_ALGO_NAME", "8"),
|
||||
@ -338,7 +630,10 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
("OSTREE_MAX_METADATA_WARN_SIZE", "7340032"),
|
||||
("OSTREE_METADATA_KEY_BOOTABLE", "ostree.bootable"),
|
||||
("OSTREE_METADATA_KEY_LINUX", "ostree.linux"),
|
||||
("OSTREE_META_KEY_DEPLOY_COLLECTION_ID", "ostree.deploy-collection-id"),
|
||||
(
|
||||
"OSTREE_META_KEY_DEPLOY_COLLECTION_ID",
|
||||
"ostree.deploy-collection-id",
|
||||
),
|
||||
("(gint) OSTREE_OBJECT_TYPE_COMMIT", "4"),
|
||||
("(gint) OSTREE_OBJECT_TYPE_COMMIT_META", "6"),
|
||||
("(gint) OSTREE_OBJECT_TYPE_DIR_META", "3"),
|
||||
@ -361,11 +656,23 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
("(gint) OSTREE_REPO_COMMIT_ITER_RESULT_END", "1"),
|
||||
("(gint) OSTREE_REPO_COMMIT_ITER_RESULT_ERROR", "0"),
|
||||
("(gint) OSTREE_REPO_COMMIT_ITER_RESULT_FILE", "2"),
|
||||
("(guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CANONICAL_PERMISSIONS", "4"),
|
||||
(
|
||||
"(guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CANONICAL_PERMISSIONS",
|
||||
"4",
|
||||
),
|
||||
("(guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CONSUME", "16"),
|
||||
("(guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_DEVINO_CANONICAL", "32"),
|
||||
("(guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_ERROR_ON_UNLABELED", "8"),
|
||||
("(guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES", "2"),
|
||||
(
|
||||
"(guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_DEVINO_CANONICAL",
|
||||
"32",
|
||||
),
|
||||
(
|
||||
"(guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_ERROR_ON_UNLABELED",
|
||||
"8",
|
||||
),
|
||||
(
|
||||
"(guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES",
|
||||
"2",
|
||||
),
|
||||
("(guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_NONE", "0"),
|
||||
("(guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SKIP_XATTRS", "1"),
|
||||
("(guint) OSTREE_REPO_COMMIT_STATE_FSCK_PARTIAL", "2"),
|
||||
@ -402,8 +709,14 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
("(gint) OSTREE_REPO_REMOTE_CHANGE_REPLACE", "4"),
|
||||
("(guint) OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY", "1"),
|
||||
("(guint) OSTREE_REPO_RESOLVE_REV_EXT_NONE", "0"),
|
||||
("(guint) OSTREE_SEPOLICY_RESTORECON_FLAGS_ALLOW_NOLABEL", "1"),
|
||||
("(guint) OSTREE_SEPOLICY_RESTORECON_FLAGS_KEEP_EXISTING", "2"),
|
||||
(
|
||||
"(guint) OSTREE_SEPOLICY_RESTORECON_FLAGS_ALLOW_NOLABEL",
|
||||
"1",
|
||||
),
|
||||
(
|
||||
"(guint) OSTREE_SEPOLICY_RESTORECON_FLAGS_KEEP_EXISTING",
|
||||
"2",
|
||||
),
|
||||
("(guint) OSTREE_SEPOLICY_RESTORECON_FLAGS_NONE", "0"),
|
||||
("OSTREE_SHA256_DIGEST_LEN", "32"),
|
||||
("OSTREE_SHA256_STRING_LEN", "64"),
|
||||
@ -413,18 +726,40 @@ const RUST_CONSTANTS: &[(&str, &str)] = &[
|
||||
("(gint) OSTREE_STATIC_DELTA_INDEX_FLAGS_NONE", "0"),
|
||||
("OSTREE_SUMMARY_GVARIANT_STRING", "(a(s(taya{sv}))a{sv})"),
|
||||
("OSTREE_SUMMARY_SIG_GVARIANT_STRING", "a{sv}"),
|
||||
("(guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NONE", "0"),
|
||||
("(guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NOT_DEFAULT", "2"),
|
||||
("(guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NO_CLEAN", "4"),
|
||||
("(guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN", "1"),
|
||||
("(guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_PENDING", "8"),
|
||||
("(guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_ROLLBACK", "16"),
|
||||
("(guint) OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED", "2"),
|
||||
("(guint) OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_ALLOW_OLDER", "1"),
|
||||
(
|
||||
"(guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NONE",
|
||||
"0",
|
||||
),
|
||||
(
|
||||
"(guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NOT_DEFAULT",
|
||||
"2",
|
||||
),
|
||||
(
|
||||
"(guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NO_CLEAN",
|
||||
"4",
|
||||
),
|
||||
(
|
||||
"(guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN",
|
||||
"1",
|
||||
),
|
||||
(
|
||||
"(guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_PENDING",
|
||||
"8",
|
||||
),
|
||||
(
|
||||
"(guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_ROLLBACK",
|
||||
"16",
|
||||
),
|
||||
(
|
||||
"(guint) OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED",
|
||||
"2",
|
||||
),
|
||||
(
|
||||
"(guint) OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_ALLOW_OLDER",
|
||||
"1",
|
||||
),
|
||||
("(guint) OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_NONE", "0"),
|
||||
("(guint) OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_SYNTHETIC", "2"),
|
||||
("OSTREE_TIMESTAMP", "0"),
|
||||
("OSTREE_TREE_GVARIANT_STRING", "(a(say)a(sayay))"),
|
||||
];
|
||||
|
||||
|
||||
|
@ -1,27 +1,163 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
#include "manual.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define PRINT_CONSTANT(CONSTANT_NAME) \
|
||||
printf("%s;", #CONSTANT_NAME); \
|
||||
printf(_Generic((CONSTANT_NAME), \
|
||||
char *: "%s", \
|
||||
const char *: "%s", \
|
||||
char: "%c", \
|
||||
signed char: "%hhd", \
|
||||
unsigned char: "%hhu", \
|
||||
short int: "%hd", \
|
||||
unsigned short int: "%hu", \
|
||||
int: "%d", \
|
||||
unsigned int: "%u", \
|
||||
long: "%ld", \
|
||||
unsigned long: "%lu", \
|
||||
long long: "%lld", \
|
||||
unsigned long long: "%llu", \
|
||||
float: "%f", \
|
||||
double: "%f", \
|
||||
long double: "%ld"), \
|
||||
CONSTANT_NAME); \
|
||||
printf("\n");
|
||||
|
||||
int main() {
|
||||
printf(_Generic((ABI_CONSTANT_NAME),
|
||||
char *: "###gir test###%s###gir test###\n",
|
||||
const char *: "###gir test###%s###gir test###\n",
|
||||
char: "###gir test###%c###gir test###\n",
|
||||
signed char: "###gir test###%hhd###gir test###\n",
|
||||
unsigned char: "###gir test###%hhu###gir test###\n",
|
||||
short int: "###gir test###%hd###gir test###\n",
|
||||
unsigned short int: "###gir test###%hu###gir test###\n",
|
||||
int: "###gir test###%d###gir test###\n",
|
||||
unsigned int: "###gir test###%u###gir test###\n",
|
||||
long: "###gir test###%ld###gir test###\n",
|
||||
unsigned long: "###gir test###%lu###gir test###\n",
|
||||
long long: "###gir test###%lld###gir test###\n",
|
||||
unsigned long long: "###gir test###%llu###gir test###\n",
|
||||
double: "###gir test###%f###gir test###\n",
|
||||
long double: "###gir test###%ld###gir test###\n"),
|
||||
ABI_CONSTANT_NAME);
|
||||
PRINT_CONSTANT((guint) OSTREE_CHECKSUM_FLAGS_IGNORE_XATTRS);
|
||||
PRINT_CONSTANT((guint) OSTREE_CHECKSUM_FLAGS_NONE);
|
||||
PRINT_CONSTANT(OSTREE_COMMIT_GVARIANT_STRING);
|
||||
PRINT_CONSTANT(OSTREE_COMMIT_META_KEY_ARCHITECTURE);
|
||||
PRINT_CONSTANT(OSTREE_COMMIT_META_KEY_COLLECTION_BINDING);
|
||||
PRINT_CONSTANT(OSTREE_COMMIT_META_KEY_ENDOFLIFE);
|
||||
PRINT_CONSTANT(OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE);
|
||||
PRINT_CONSTANT(OSTREE_COMMIT_META_KEY_REF_BINDING);
|
||||
PRINT_CONSTANT(OSTREE_COMMIT_META_KEY_SOURCE_TITLE);
|
||||
PRINT_CONSTANT(OSTREE_COMMIT_META_KEY_VERSION);
|
||||
PRINT_CONSTANT((gint) OSTREE_DEPLOYMENT_UNLOCKED_DEVELOPMENT);
|
||||
PRINT_CONSTANT((gint) OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX);
|
||||
PRINT_CONSTANT((gint) OSTREE_DEPLOYMENT_UNLOCKED_NONE);
|
||||
PRINT_CONSTANT((gint) OSTREE_DEPLOYMENT_UNLOCKED_TRANSIENT);
|
||||
PRINT_CONSTANT((guint) OSTREE_DIFF_FLAGS_IGNORE_XATTRS);
|
||||
PRINT_CONSTANT((guint) OSTREE_DIFF_FLAGS_NONE);
|
||||
PRINT_CONSTANT(OSTREE_DIRMETA_GVARIANT_STRING);
|
||||
PRINT_CONSTANT(OSTREE_FILEMETA_GVARIANT_STRING);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_ERROR_EXPIRED_KEY);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_ERROR_EXPIRED_SIGNATURE);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_ERROR_INVALID_SIGNATURE);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_ERROR_MISSING_KEY);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_ERROR_NO_SIGNATURE);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_ERROR_REVOKED_KEY);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_EXP_TIMESTAMP);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_FINGERPRINT_PRIMARY);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_HASH_ALGO_NAME);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_EXPIRED);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_EXP_TIMESTAMP_PRIMARY);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_MISSING);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_KEY_REVOKED);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_PUBKEY_ALGO_NAME);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_SIG_EXPIRED);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_TIMESTAMP);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_USER_EMAIL);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_USER_NAME);
|
||||
PRINT_CONSTANT((gint) OSTREE_GPG_SIGNATURE_ATTR_VALID);
|
||||
PRINT_CONSTANT((guint) OSTREE_GPG_SIGNATURE_FORMAT_DEFAULT);
|
||||
PRINT_CONSTANT(OSTREE_MAX_METADATA_SIZE);
|
||||
PRINT_CONSTANT(OSTREE_MAX_METADATA_WARN_SIZE);
|
||||
PRINT_CONSTANT(OSTREE_METADATA_KEY_BOOTABLE);
|
||||
PRINT_CONSTANT(OSTREE_METADATA_KEY_LINUX);
|
||||
PRINT_CONSTANT(OSTREE_META_KEY_DEPLOY_COLLECTION_ID);
|
||||
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_COMMIT);
|
||||
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_COMMIT_META);
|
||||
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_DIR_META);
|
||||
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_DIR_TREE);
|
||||
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_FILE);
|
||||
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_PAYLOAD_LINK);
|
||||
PRINT_CONSTANT((gint) OSTREE_OBJECT_TYPE_TOMBSTONE_COMMIT);
|
||||
PRINT_CONSTANT(OSTREE_ORIGIN_TRANSIENT_GROUP);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_FILTER_ALLOW);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_FILTER_SKIP);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_MODE_NONE);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_MODE_USER);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_OVERWRITE_NONE);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_COMMIT_FILTER_ALLOW);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_COMMIT_FILTER_SKIP);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_COMMIT_ITER_RESULT_DIR);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_COMMIT_ITER_RESULT_END);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_COMMIT_ITER_RESULT_ERROR);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_COMMIT_ITER_RESULT_FILE);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CANONICAL_PERMISSIONS);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_CONSUME);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_DEVINO_CANONICAL);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_ERROR_ON_UNLABELED);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_NONE);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_MODIFIER_FLAGS_SKIP_XATTRS);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_STATE_FSCK_PARTIAL);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_STATE_NORMAL);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_STATE_PARTIAL);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_COMMIT_TRAVERSE_FLAG_NONE);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_OBJECTS_ALL);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_OBJECTS_LOOSE);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_OBJECTS_NO_PARENTS);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_OBJECTS_PACKED);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_REFS_EXT_ALIASES);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_MIRRORS);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_REFS_EXT_EXCLUDE_REMOTES);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_LIST_REFS_EXT_NONE);
|
||||
PRINT_CONSTANT(OSTREE_REPO_METADATA_REF);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_MODE_ARCHIVE);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_MODE_ARCHIVE_Z2);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_MODE_BARE);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_MODE_BARE_USER);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_MODE_BARE_USER_ONLY);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_PRUNE_FLAGS_NONE);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_PULL_FLAGS_BAREUSERONLY_FILES);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_PULL_FLAGS_COMMIT_ONLY);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_PULL_FLAGS_MIRROR);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_PULL_FLAGS_NONE);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_PULL_FLAGS_TRUSTED_HTTP);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_PULL_FLAGS_UNTRUSTED);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_REMOTE_CHANGE_ADD);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_REMOTE_CHANGE_DELETE);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS);
|
||||
PRINT_CONSTANT((gint) OSTREE_REPO_REMOTE_CHANGE_REPLACE);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_RESOLVE_REV_EXT_LOCAL_ONLY);
|
||||
PRINT_CONSTANT((guint) OSTREE_REPO_RESOLVE_REV_EXT_NONE);
|
||||
PRINT_CONSTANT((guint) OSTREE_SEPOLICY_RESTORECON_FLAGS_ALLOW_NOLABEL);
|
||||
PRINT_CONSTANT((guint) OSTREE_SEPOLICY_RESTORECON_FLAGS_KEEP_EXISTING);
|
||||
PRINT_CONSTANT((guint) OSTREE_SEPOLICY_RESTORECON_FLAGS_NONE);
|
||||
PRINT_CONSTANT(OSTREE_SHA256_DIGEST_LEN);
|
||||
PRINT_CONSTANT(OSTREE_SHA256_STRING_LEN);
|
||||
PRINT_CONSTANT(OSTREE_SIGN_NAME_ED25519);
|
||||
PRINT_CONSTANT((gint) OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY);
|
||||
PRINT_CONSTANT((gint) OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR);
|
||||
PRINT_CONSTANT((gint) OSTREE_STATIC_DELTA_INDEX_FLAGS_NONE);
|
||||
PRINT_CONSTANT(OSTREE_SUMMARY_GVARIANT_STRING);
|
||||
PRINT_CONSTANT(OSTREE_SUMMARY_SIG_GVARIANT_STRING);
|
||||
PRINT_CONSTANT((guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NONE);
|
||||
PRINT_CONSTANT((guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NOT_DEFAULT);
|
||||
PRINT_CONSTANT((guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NO_CLEAN);
|
||||
PRINT_CONSTANT((guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN);
|
||||
PRINT_CONSTANT((guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_PENDING);
|
||||
PRINT_CONSTANT((guint) OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN_ROLLBACK);
|
||||
PRINT_CONSTANT((guint) OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED);
|
||||
PRINT_CONSTANT((guint) OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_ALLOW_OLDER);
|
||||
PRINT_CONSTANT((guint) OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_NONE);
|
||||
PRINT_CONSTANT((guint) OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_SYNTHETIC);
|
||||
PRINT_CONSTANT(OSTREE_TIMESTAMP);
|
||||
PRINT_CONSTANT(OSTREE_TREE_GVARIANT_STRING);
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// from gir-files
|
||||
// DO NOT EDIT
|
||||
|
||||
#include "manual.h"
|
||||
@ -7,6 +7,57 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
printf("%zu\n%zu", sizeof(ABI_TYPE_NAME), alignof(ABI_TYPE_NAME));
|
||||
printf("%s;%zu;%zu\n", "OstreeAsyncProgressClass", sizeof(OstreeAsyncProgressClass), alignof(OstreeAsyncProgressClass));
|
||||
printf("%s;%zu;%zu\n", "OstreeChecksumFlags", sizeof(OstreeChecksumFlags), alignof(OstreeChecksumFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeCollectionRef", sizeof(OstreeCollectionRef), alignof(OstreeCollectionRef));
|
||||
printf("%s;%zu;%zu\n", "OstreeCollectionRefv", sizeof(OstreeCollectionRefv), alignof(OstreeCollectionRefv));
|
||||
printf("%s;%zu;%zu\n", "OstreeCommitSizesEntry", sizeof(OstreeCommitSizesEntry), alignof(OstreeCommitSizesEntry));
|
||||
printf("%s;%zu;%zu\n", "OstreeContentWriterClass", sizeof(OstreeContentWriterClass), alignof(OstreeContentWriterClass));
|
||||
printf("%s;%zu;%zu\n", "OstreeDeploymentUnlockedState", sizeof(OstreeDeploymentUnlockedState), alignof(OstreeDeploymentUnlockedState));
|
||||
printf("%s;%zu;%zu\n", "OstreeDiffDirsOptions", sizeof(OstreeDiffDirsOptions), alignof(OstreeDiffDirsOptions));
|
||||
printf("%s;%zu;%zu\n", "OstreeDiffFlags", sizeof(OstreeDiffFlags), alignof(OstreeDiffFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeDiffItem", sizeof(OstreeDiffItem), alignof(OstreeDiffItem));
|
||||
printf("%s;%zu;%zu\n", "OstreeGpgError", sizeof(OstreeGpgError), alignof(OstreeGpgError));
|
||||
printf("%s;%zu;%zu\n", "OstreeGpgSignatureAttr", sizeof(OstreeGpgSignatureAttr), alignof(OstreeGpgSignatureAttr));
|
||||
printf("%s;%zu;%zu\n", "OstreeGpgSignatureFormatFlags", sizeof(OstreeGpgSignatureFormatFlags), alignof(OstreeGpgSignatureFormatFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeMutableTreeClass", sizeof(OstreeMutableTreeClass), alignof(OstreeMutableTreeClass));
|
||||
printf("%s;%zu;%zu\n", "OstreeMutableTreeIter", sizeof(OstreeMutableTreeIter), alignof(OstreeMutableTreeIter));
|
||||
printf("%s;%zu;%zu\n", "OstreeObjectType", sizeof(OstreeObjectType), alignof(OstreeObjectType));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoCheckoutAtOptions", sizeof(OstreeRepoCheckoutAtOptions), alignof(OstreeRepoCheckoutAtOptions));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoCheckoutFilterResult", sizeof(OstreeRepoCheckoutFilterResult), alignof(OstreeRepoCheckoutFilterResult));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoCheckoutMode", sizeof(OstreeRepoCheckoutMode), alignof(OstreeRepoCheckoutMode));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoCheckoutOverwriteMode", sizeof(OstreeRepoCheckoutOverwriteMode), alignof(OstreeRepoCheckoutOverwriteMode));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoCommitFilterResult", sizeof(OstreeRepoCommitFilterResult), alignof(OstreeRepoCommitFilterResult));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoCommitIterResult", sizeof(OstreeRepoCommitIterResult), alignof(OstreeRepoCommitIterResult));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoCommitModifierFlags", sizeof(OstreeRepoCommitModifierFlags), alignof(OstreeRepoCommitModifierFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoCommitState", sizeof(OstreeRepoCommitState), alignof(OstreeRepoCommitState));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoCommitTraverseFlags", sizeof(OstreeRepoCommitTraverseFlags), alignof(OstreeRepoCommitTraverseFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoCommitTraverseIter", sizeof(OstreeRepoCommitTraverseIter), alignof(OstreeRepoCommitTraverseIter));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoFileClass", sizeof(OstreeRepoFileClass), alignof(OstreeRepoFileClass));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoFinderAvahiClass", sizeof(OstreeRepoFinderAvahiClass), alignof(OstreeRepoFinderAvahiClass));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoFinderConfigClass", sizeof(OstreeRepoFinderConfigClass), alignof(OstreeRepoFinderConfigClass));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoFinderInterface", sizeof(OstreeRepoFinderInterface), alignof(OstreeRepoFinderInterface));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoFinderMountClass", sizeof(OstreeRepoFinderMountClass), alignof(OstreeRepoFinderMountClass));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoFinderOverrideClass", sizeof(OstreeRepoFinderOverrideClass), alignof(OstreeRepoFinderOverrideClass));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoFinderResult", sizeof(OstreeRepoFinderResult), alignof(OstreeRepoFinderResult));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoFinderResultv", sizeof(OstreeRepoFinderResultv), alignof(OstreeRepoFinderResultv));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoListObjectsFlags", sizeof(OstreeRepoListObjectsFlags), alignof(OstreeRepoListObjectsFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoListRefsExtFlags", sizeof(OstreeRepoListRefsExtFlags), alignof(OstreeRepoListRefsExtFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoMode", sizeof(OstreeRepoMode), alignof(OstreeRepoMode));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoPruneFlags", sizeof(OstreeRepoPruneFlags), alignof(OstreeRepoPruneFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoPruneOptions", sizeof(OstreeRepoPruneOptions), alignof(OstreeRepoPruneOptions));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoPullFlags", sizeof(OstreeRepoPullFlags), alignof(OstreeRepoPullFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoRemoteChange", sizeof(OstreeRepoRemoteChange), alignof(OstreeRepoRemoteChange));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoResolveRevExtFlags", sizeof(OstreeRepoResolveRevExtFlags), alignof(OstreeRepoResolveRevExtFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeRepoTransactionStats", sizeof(OstreeRepoTransactionStats), alignof(OstreeRepoTransactionStats));
|
||||
printf("%s;%zu;%zu\n", "OstreeSePolicyRestoreconFlags", sizeof(OstreeSePolicyRestoreconFlags), alignof(OstreeSePolicyRestoreconFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeSignInterface", sizeof(OstreeSignInterface), alignof(OstreeSignInterface));
|
||||
printf("%s;%zu;%zu\n", "OstreeStaticDeltaGenerateOpt", sizeof(OstreeStaticDeltaGenerateOpt), alignof(OstreeStaticDeltaGenerateOpt));
|
||||
printf("%s;%zu;%zu\n", "OstreeStaticDeltaIndexFlags", sizeof(OstreeStaticDeltaIndexFlags), alignof(OstreeStaticDeltaIndexFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeSysrootDeployTreeOpts", sizeof(OstreeSysrootDeployTreeOpts), alignof(OstreeSysrootDeployTreeOpts));
|
||||
printf("%s;%zu;%zu\n", "OstreeSysrootSimpleWriteDeploymentFlags", sizeof(OstreeSysrootSimpleWriteDeploymentFlags), alignof(OstreeSysrootSimpleWriteDeploymentFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeSysrootUpgraderFlags", sizeof(OstreeSysrootUpgraderFlags), alignof(OstreeSysrootUpgraderFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeSysrootUpgraderPullFlags", sizeof(OstreeSysrootUpgraderPullFlags), alignof(OstreeSysrootUpgraderPullFlags));
|
||||
printf("%s;%zu;%zu\n", "OstreeSysrootWriteDeploymentsOpts", sizeof(OstreeSysrootWriteDeploymentsOpts), alignof(OstreeSysrootWriteDeploymentsOpts));
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::util::TestRepo;
|
||||
use gio::NONE_CANCELLABLE;
|
||||
use ostree::{checksum_file_from_input, ObjectType};
|
||||
use util::TestRepo;
|
||||
|
||||
#[test]
|
||||
fn should_checksum_file_from_input() {
|
||||
|
@ -32,7 +32,7 @@ fn should_traverse_commit() {
|
||||
.expect("traverse commit");
|
||||
|
||||
assert_eq!(
|
||||
hashset!(
|
||||
maplit::hashset!(
|
||||
ObjectName::new(
|
||||
"89f84ca9854a80e85b583e46a115ba4985254437027bad34f0b113219323d3f8",
|
||||
ObjectType::File
|
||||
@ -76,7 +76,7 @@ fn should_checkout_tree() {
|
||||
.checkout_tree(
|
||||
ostree::RepoCheckoutMode::User,
|
||||
ostree::RepoCheckoutOverwriteMode::None,
|
||||
&gio::File::new_for_path(checkout_dir.path().join("test-checkout")),
|
||||
&gio::File::for_path(checkout_dir.path().join("test-checkout")),
|
||||
&file,
|
||||
&info,
|
||||
NONE_CANCELLABLE,
|
||||
|
@ -1,11 +1,3 @@
|
||||
extern crate gio;
|
||||
extern crate glib;
|
||||
extern crate openat;
|
||||
extern crate ostree;
|
||||
extern crate tempfile;
|
||||
#[macro_use]
|
||||
extern crate maplit;
|
||||
|
||||
mod functions;
|
||||
mod repo;
|
||||
#[cfg(feature = "v2020_2")]
|
||||
|
@ -30,7 +30,7 @@ impl TestRepo {
|
||||
|
||||
pub fn create_mtree(repo: &ostree::Repo) -> ostree::MutableTree {
|
||||
let mtree = ostree::MutableTree::new();
|
||||
let file = gio::File::new_for_path(
|
||||
let file = gio::File::for_path(
|
||||
Path::new(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("tests")
|
||||
.join("data")
|
||||
|
Loading…
Reference in New Issue
Block a user