ostree/cargo: bump to ostree-sys 0.9.2

This commit is contained in:
Luca BRUNO authored and Colin Walters committed 2022-05-06 12:53:57 -04:00
1 parent 61b4629b37
commit 3fc55a524b
91 files changed
+2 -1

No files matched your search

+157
View File
@@ -0,0 +1,157 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use glib::object::ObjectType as ObjectType_;
use glib::signal::connect_raw;
use glib::signal::SignalHandlerId;
use glib::translate::*;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem::transmute;
glib::wrapper! {
#[doc(alias = "OstreeAsyncProgress")]
pub struct AsyncProgress(Object<ffi::OstreeAsyncProgress, ffi::OstreeAsyncProgressClass>);
match fn {
type_ => || ffi::ostree_async_progress_get_type(),
}
}
impl AsyncProgress {
#[doc(alias = "ostree_async_progress_new")]
pub fn new() -> AsyncProgress {
unsafe {
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 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 {
fn default() -> Self {
Self::new()
}
}
impl fmt::Display for AsyncProgress {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("AsyncProgress")
}
}
+114
View File
@@ -0,0 +1,114 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use glib::object::IsA;
use glib::translate::*;
use std::fmt;
use std::ptr;
glib::wrapper! {
#[doc(alias = "OstreeBootconfigParser")]
pub struct BootconfigParser(Object<ffi::OstreeBootconfigParser>);
match fn {
type_ => || ffi::ostree_bootconfig_parser_get_type(),
}
}
impl BootconfigParser {
#[doc(alias = "ostree_bootconfig_parser_new")]
pub fn new() -> BootconfigParser {
unsafe {
from_glib_full(ffi::ostree_bootconfig_parser_new())
}
}
#[doc(alias = "ostree_bootconfig_parser_clone")]
pub fn clone(&self) -> Option<BootconfigParser> {
unsafe {
from_glib_full(ffi::ostree_bootconfig_parser_clone(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_bootconfig_parser_get")]
pub fn get(&self, key: &str) -> Option<glib::GString> {
unsafe {
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"))]
#[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(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 _ = 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 _ = 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 {
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 {
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 _ = 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 _ = 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)) }
}
}
}
impl Default for BootconfigParser {
fn default() -> Self {
Self::new()
}
}
impl fmt::Display for BootconfigParser {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("BootconfigParser")
}
}
+56
View File
@@ -0,0 +1,56 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use glib::translate::*;
use std::hash;
glib::wrapper! {
#[derive(Debug, PartialOrd, Ord)]
pub struct CollectionRef(Boxed<ffi::OstreeCollectionRef>);
match fn {
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 {
#[doc(alias = "ostree_collection_ref_new")]
pub fn new(collection_id: Option<&str>, ref_name: &str) -> Option<CollectionRef> {
unsafe {
from_glib_full(ffi::ostree_collection_ref_new(collection_id.to_glib_none().0, ref_name.to_glib_none().0))
}
}
#[doc(alias = "ostree_collection_ref_equal")]
fn equal(&self, ref2: &CollectionRef) -> bool {
unsafe {
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))
}
}
#[doc(alias = "ostree_collection_ref_hash")]
fn hash(&self) -> u32 {
unsafe {
ffi::ostree_collection_ref_hash(ToGlibPtr::<*const ffi::OstreeCollectionRef>::to_glib_none(self).0 as glib::ffi::gconstpointer)
}
}
}
impl PartialEq for CollectionRef {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.equal(other)
}
}
impl Eq for CollectionRef {}
impl hash::Hash for CollectionRef {
#[inline]
fn hash<H>(&self, state: &mut H) where H: hash::Hasher {
hash::Hash::hash(&self.hash(), state)
}
}
+26
View File
@@ -0,0 +1,26 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use crate::ObjectType;
use glib::translate::*;
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct CommitSizesEntry(Boxed<ffi::OstreeCommitSizesEntry>);
match fn {
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 {
#[doc(alias = "ostree_commit_sizes_entry_new")]
pub fn new(checksum: &str, objtype: ObjectType, unpacked: u64, archived: u64) -> Option<CommitSizesEntry> {
unsafe {
from_glib_full(ffi::ostree_commit_sizes_entry_new(checksum.to_glib_none().0, objtype.into_glib(), unpacked, archived))
}
}
}
+72
View File
@@ -0,0 +1,72 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use std::ffi::CStr;
#[doc(alias = "OSTREE_COMMIT_GVARIANT_STRING")]
pub static COMMIT_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_GVARIANT_STRING).to_str().unwrap()});
#[cfg(any(feature = "v2020_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))]
#[doc(alias = "OSTREE_COMMIT_META_KEY_ARCHITECTURE")]
pub static COMMIT_META_KEY_ARCHITECTURE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_ARCHITECTURE).to_str().unwrap()});
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
#[doc(alias = "OSTREE_COMMIT_META_KEY_COLLECTION_BINDING")]
pub static COMMIT_META_KEY_COLLECTION_BINDING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_COLLECTION_BINDING).to_str().unwrap()});
#[cfg(any(feature = "v2017_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))]
#[doc(alias = "OSTREE_COMMIT_META_KEY_ENDOFLIFE")]
pub static COMMIT_META_KEY_ENDOFLIFE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_ENDOFLIFE).to_str().unwrap()});
#[cfg(any(feature = "v2017_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))]
#[doc(alias = "OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE")]
pub static COMMIT_META_KEY_ENDOFLIFE_REBASE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_ENDOFLIFE_REBASE).to_str().unwrap()});
#[cfg(any(feature = "v2017_9", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_9")))]
#[doc(alias = "OSTREE_COMMIT_META_KEY_REF_BINDING")]
pub static COMMIT_META_KEY_REF_BINDING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_REF_BINDING).to_str().unwrap()});
#[cfg(any(feature = "v2017_13", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
#[doc(alias = "OSTREE_COMMIT_META_KEY_SOURCE_TITLE")]
pub static COMMIT_META_KEY_SOURCE_TITLE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_COMMIT_META_KEY_SOURCE_TITLE).to_str().unwrap()});
#[cfg(any(feature = "v2014_9", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2014_9")))]
#[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()});
#[doc(alias = "OSTREE_GPG_KEY_GVARIANT_STRING")]
pub static GPG_KEY_GVARIANT_STRING: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_GPG_KEY_GVARIANT_STRING).to_str().unwrap()});
#[cfg(any(feature = "v2021_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))]
#[doc(alias = "OSTREE_METADATA_KEY_BOOTABLE")]
pub static METADATA_KEY_BOOTABLE: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_METADATA_KEY_BOOTABLE).to_str().unwrap()});
#[cfg(any(feature = "v2021_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_1")))]
#[doc(alias = "OSTREE_METADATA_KEY_LINUX")]
pub static METADATA_KEY_LINUX: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_METADATA_KEY_LINUX).to_str().unwrap()});
#[cfg(any(feature = "v2018_9", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_9")))]
#[doc(alias = "OSTREE_META_KEY_DEPLOY_COLLECTION_ID")]
pub static META_KEY_DEPLOY_COLLECTION_ID: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe{CStr::from_ptr(ffi::OSTREE_META_KEY_DEPLOY_COLLECTION_ID).to_str().unwrap()});
#[cfg(any(feature = "v2018_3", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_3")))]
#[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"))]
#[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"))]
#[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()});
+34
View File
@@ -0,0 +1,34 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use glib::object::IsA;
use glib::translate::*;
use std::fmt;
use std::ptr;
glib::wrapper! {
#[doc(alias = "OstreeContentWriter")]
pub struct ContentWriter(Object<ffi::OstreeContentWriter, ffi::OstreeContentWriterClass>) @extends gio::OutputStream;
match fn {
type_ => || ffi::ostree_content_writer_get_type(),
}
}
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 = ffi::ostree_content_writer_finish(self.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
}
}
impl fmt::Display for ContentWriter {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("ContentWriter")
}
}
+201
View File
@@ -0,0 +1,201 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use crate::BootconfigParser;
#[cfg(any(feature = "v2016_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
use crate::DeploymentUnlockedState;
use glib::translate::*;
use std::fmt;
glib::wrapper! {
#[doc(alias = "OstreeDeployment")]
pub struct Deployment(Object<ffi::OstreeDeployment>);
match fn {
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(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(ffi::ostree_deployment_clone(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_deployment_equal")]
pub fn equal(&self, bp: &Deployment) -> bool {
unsafe {
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))
}
}
#[doc(alias = "ostree_deployment_get_bootconfig")]
#[doc(alias = "get_bootconfig")]
pub fn bootconfig(&self) -> Option<BootconfigParser> {
unsafe {
from_glib_none(ffi::ostree_deployment_get_bootconfig(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_deployment_get_bootcsum")]
#[doc(alias = "get_bootcsum")]
pub fn bootcsum(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::ostree_deployment_get_bootcsum(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_deployment_get_bootserial")]
#[doc(alias = "get_bootserial")]
pub fn bootserial(&self) -> i32 {
unsafe {
ffi::ostree_deployment_get_bootserial(self.to_glib_none().0)
}
}
#[doc(alias = "ostree_deployment_get_csum")]
#[doc(alias = "get_csum")]
pub fn csum(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::ostree_deployment_get_csum(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_deployment_get_deployserial")]
#[doc(alias = "get_deployserial")]
pub fn deployserial(&self) -> i32 {
unsafe {
ffi::ostree_deployment_get_deployserial(self.to_glib_none().0)
}
}
#[doc(alias = "ostree_deployment_get_index")]
#[doc(alias = "get_index")]
pub fn index(&self) -> i32 {
unsafe {
ffi::ostree_deployment_get_index(self.to_glib_none().0)
}
}
#[doc(alias = "ostree_deployment_get_origin")]
#[doc(alias = "get_origin")]
pub fn origin(&self) -> Option<glib::KeyFile> {
unsafe {
from_glib_none(ffi::ostree_deployment_get_origin(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_deployment_get_origin_relpath")]
#[doc(alias = "get_origin_relpath")]
pub fn origin_relpath(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::ostree_deployment_get_origin_relpath(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_deployment_get_osname")]
#[doc(alias = "get_osname")]
pub fn osname(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::ostree_deployment_get_osname(self.to_glib_none().0))
}
}
#[cfg(any(feature = "v2016_4", feature = "dox"))]
#[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(ffi::ostree_deployment_get_unlocked(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_deployment_hash")]
pub fn hash(&self) -> u32 {
unsafe {
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(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(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 {
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 {
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 {
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 {
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 {
ffi::ostree_deployment_origin_remove_transient_state(origin.to_glib_none().0);
}
}
#[cfg(any(feature = "v2016_4", feature = "dox"))]
#[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(ffi::ostree_deployment_unlocked_state_to_string(state.into_glib()))
}
}
}
impl fmt::Display for Deployment {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Deployment")
}
}
+15
View File
@@ -0,0 +1,15 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DiffItem(Shared<ffi::OstreeDiffItem>);
match fn {
ref => |ptr| ffi::ostree_diff_item_ref(ptr),
unref => |ptr| ffi::ostree_diff_item_unref(ptr),
type_ => || ffi::ostree_diff_item_get_type(),
}
}
+677
View File
@@ -0,0 +1,677 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use glib::translate::*;
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)]
__Unknown(i32),
}
impl fmt::Display for DeploymentUnlockedState {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "DeploymentUnlockedState::{}", match *self {
Self::None => "None",
Self::Development => "Development",
Self::Hotfix => "Hotfix",
Self::Transient => "Transient",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for DeploymentUnlockedState {
type GlibType = ffi::OstreeDeploymentUnlockedState;
fn into_glib(self) -> ffi::OstreeDeploymentUnlockedState {
match self {
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<ffi::OstreeDeploymentUnlockedState> for DeploymentUnlockedState {
unsafe fn from_glib(value: ffi::OstreeDeploymentUnlockedState) -> Self {
match value {
ffi::OSTREE_DEPLOYMENT_UNLOCKED_NONE => Self::None,
ffi::OSTREE_DEPLOYMENT_UNLOCKED_DEVELOPMENT => Self::Development,
ffi::OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX => Self::Hotfix,
ffi::OSTREE_DEPLOYMENT_UNLOCKED_TRANSIENT => Self::Transient,
value => Self::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[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)]
__Unknown(i32),
}
impl fmt::Display for GpgSignatureAttr {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "GpgSignatureAttr::{}", match *self {
Self::Valid => "Valid",
Self::SigExpired => "SigExpired",
Self::KeyExpired => "KeyExpired",
Self::KeyRevoked => "KeyRevoked",
Self::KeyMissing => "KeyMissing",
Self::Fingerprint => "Fingerprint",
Self::Timestamp => "Timestamp",
Self::ExpTimestamp => "ExpTimestamp",
Self::PubkeyAlgoName => "PubkeyAlgoName",
Self::HashAlgoName => "HashAlgoName",
Self::UserName => "UserName",
Self::UserEmail => "UserEmail",
Self::FingerprintPrimary => "FingerprintPrimary",
Self::KeyExpTimestamp => "KeyExpTimestamp",
Self::KeyExpTimestampPrimary => "KeyExpTimestampPrimary",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for GpgSignatureAttr {
type GlibType = ffi::OstreeGpgSignatureAttr;
fn into_glib(self) -> ffi::OstreeGpgSignatureAttr {
match self {
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<ffi::OstreeGpgSignatureAttr> for GpgSignatureAttr {
unsafe fn from_glib(value: ffi::OstreeGpgSignatureAttr) -> Self {
match value {
ffi::OSTREE_GPG_SIGNATURE_ATTR_VALID => Self::Valid,
ffi::OSTREE_GPG_SIGNATURE_ATTR_SIG_EXPIRED => Self::SigExpired,
ffi::OSTREE_GPG_SIGNATURE_ATTR_KEY_EXPIRED => Self::KeyExpired,
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)]
__Unknown(i32),
}
impl fmt::Display for ObjectType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "ObjectType::{}", match *self {
Self::File => "File",
Self::DirTree => "DirTree",
Self::DirMeta => "DirMeta",
Self::Commit => "Commit",
Self::TombstoneCommit => "TombstoneCommit",
Self::CommitMeta => "CommitMeta",
Self::PayloadLink => "PayloadLink",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for ObjectType {
type GlibType = ffi::OstreeObjectType;
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<ffi::OstreeObjectType> for ObjectType {
unsafe fn from_glib(value: ffi::OstreeObjectType) -> Self {
match value {
ffi::OSTREE_OBJECT_TYPE_FILE => Self::File,
ffi::OSTREE_OBJECT_TYPE_DIR_TREE => Self::DirTree,
ffi::OSTREE_OBJECT_TYPE_DIR_META => Self::DirMeta,
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)]
__Unknown(i32),
}
#[cfg(any(feature = "v2018_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))]
impl fmt::Display for RepoCheckoutFilterResult {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RepoCheckoutFilterResult::{}", match *self {
Self::Allow => "Allow",
Self::Skip => "Skip",
_ => "Unknown",
})
}
}
#[cfg(any(feature = "v2018_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_2")))]
#[doc(hidden)]
impl IntoGlib for RepoCheckoutFilterResult {
type GlibType = ffi::OstreeRepoCheckoutFilterResult;
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<ffi::OstreeRepoCheckoutFilterResult> for RepoCheckoutFilterResult {
unsafe fn from_glib(value: ffi::OstreeRepoCheckoutFilterResult) -> Self {
match value {
ffi::OSTREE_REPO_CHECKOUT_FILTER_ALLOW => Self::Allow,
ffi::OSTREE_REPO_CHECKOUT_FILTER_SKIP => Self::Skip,
value => Self::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[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)]
__Unknown(i32),
}
impl fmt::Display for RepoCheckoutMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RepoCheckoutMode::{}", match *self {
Self::None => "None",
Self::User => "User",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for RepoCheckoutMode {
type GlibType = ffi::OstreeRepoCheckoutMode;
fn into_glib(self) -> ffi::OstreeRepoCheckoutMode {
match self {
Self::None => ffi::OSTREE_REPO_CHECKOUT_MODE_NONE,
Self::User => ffi::OSTREE_REPO_CHECKOUT_MODE_USER,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoCheckoutMode> for RepoCheckoutMode {
unsafe fn from_glib(value: ffi::OstreeRepoCheckoutMode) -> Self {
match value {
ffi::OSTREE_REPO_CHECKOUT_MODE_NONE => Self::None,
ffi::OSTREE_REPO_CHECKOUT_MODE_USER => Self::User,
value => Self::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[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)]
__Unknown(i32),
}
impl fmt::Display for RepoCheckoutOverwriteMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RepoCheckoutOverwriteMode::{}", match *self {
Self::None => "None",
Self::UnionFiles => "UnionFiles",
Self::AddFiles => "AddFiles",
Self::UnionIdentical => "UnionIdentical",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for RepoCheckoutOverwriteMode {
type GlibType = ffi::OstreeRepoCheckoutOverwriteMode;
fn into_glib(self) -> ffi::OstreeRepoCheckoutOverwriteMode {
match self {
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<ffi::OstreeRepoCheckoutOverwriteMode> for RepoCheckoutOverwriteMode {
unsafe fn from_glib(value: ffi::OstreeRepoCheckoutOverwriteMode) -> Self {
match value {
ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_NONE => Self::None,
ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES => Self::UnionFiles,
ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES => Self::AddFiles,
ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL => Self::UnionIdentical,
value => Self::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[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)]
__Unknown(i32),
}
impl fmt::Display for RepoCommitFilterResult {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RepoCommitFilterResult::{}", match *self {
Self::Allow => "Allow",
Self::Skip => "Skip",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for RepoCommitFilterResult {
type GlibType = ffi::OstreeRepoCommitFilterResult;
fn into_glib(self) -> ffi::OstreeRepoCommitFilterResult {
match self {
Self::Allow => ffi::OSTREE_REPO_COMMIT_FILTER_ALLOW,
Self::Skip => ffi::OSTREE_REPO_COMMIT_FILTER_SKIP,
Self::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoCommitFilterResult> for RepoCommitFilterResult {
unsafe fn from_glib(value: ffi::OstreeRepoCommitFilterResult) -> Self {
match value {
ffi::OSTREE_REPO_COMMIT_FILTER_ALLOW => Self::Allow,
ffi::OSTREE_REPO_COMMIT_FILTER_SKIP => Self::Skip,
value => Self::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[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)]
__Unknown(i32),
}
impl fmt::Display for RepoCommitIterResult {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RepoCommitIterResult::{}", match *self {
Self::Error => "Error",
Self::End => "End",
Self::File => "File",
Self::Dir => "Dir",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for RepoCommitIterResult {
type GlibType = ffi::OstreeRepoCommitIterResult;
fn into_glib(self) -> ffi::OstreeRepoCommitIterResult {
match self {
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<ffi::OstreeRepoCommitIterResult> for RepoCommitIterResult {
unsafe fn from_glib(value: ffi::OstreeRepoCommitIterResult) -> Self {
match value {
ffi::OSTREE_REPO_COMMIT_ITER_RESULT_ERROR => Self::Error,
ffi::OSTREE_REPO_COMMIT_ITER_RESULT_END => Self::End,
ffi::OSTREE_REPO_COMMIT_ITER_RESULT_FILE => Self::File,
ffi::OSTREE_REPO_COMMIT_ITER_RESULT_DIR => Self::Dir,
value => Self::__Unknown(value),
}
}
}
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[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)]
__Unknown(i32),
}
impl fmt::Display for RepoMode {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RepoMode::{}", match *self {
Self::Bare => "Bare",
Self::Archive => "Archive",
Self::BareUser => "BareUser",
Self::BareUserOnly => "BareUserOnly",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for RepoMode {
type GlibType = ffi::OstreeRepoMode;
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<ffi::OstreeRepoMode> for RepoMode {
unsafe fn from_glib(value: ffi::OstreeRepoMode) -> Self {
match value {
ffi::OSTREE_REPO_MODE_BARE => Self::Bare,
ffi::OSTREE_REPO_MODE_ARCHIVE => Self::Archive,
ffi::OSTREE_REPO_MODE_BARE_USER => Self::BareUser,
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)]
__Unknown(i32),
}
impl fmt::Display for RepoRemoteChange {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "RepoRemoteChange::{}", match *self {
Self::Add => "Add",
Self::AddIfNotExists => "AddIfNotExists",
Self::Delete => "Delete",
Self::DeleteIfExists => "DeleteIfExists",
Self::Replace => "Replace",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for RepoRemoteChange {
type GlibType = ffi::OstreeRepoRemoteChange;
fn into_glib(self) -> ffi::OstreeRepoRemoteChange {
match self {
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<ffi::OstreeRepoRemoteChange> for RepoRemoteChange {
unsafe fn from_glib(value: ffi::OstreeRepoRemoteChange) -> Self {
match value {
ffi::OSTREE_REPO_REMOTE_CHANGE_ADD => Self::Add,
ffi::OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS => Self::AddIfNotExists,
ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE => Self::Delete,
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)]
__Unknown(i32),
}
impl fmt::Display for StaticDeltaGenerateOpt {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "StaticDeltaGenerateOpt::{}", match *self {
Self::Lowlatency => "Lowlatency",
Self::Major => "Major",
_ => "Unknown",
})
}
}
#[doc(hidden)]
impl IntoGlib for StaticDeltaGenerateOpt {
type GlibType = ffi::OstreeStaticDeltaGenerateOpt;
fn into_glib(self) -> ffi::OstreeStaticDeltaGenerateOpt {
match self {
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<ffi::OstreeStaticDeltaGenerateOpt> for StaticDeltaGenerateOpt {
unsafe fn from_glib(value: ffi::OstreeStaticDeltaGenerateOpt) -> Self {
match value {
ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY => Self::Lowlatency,
ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR => Self::Major,
value => Self::__Unknown(value),
}
}
}
+622
View File
@@ -0,0 +1,622 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use bitflags::bitflags;
use glib::translate::*;
use glib::value::FromValue;
use glib::value::ToValue;
use glib::StaticType;
use glib::Type;
use std::fmt;
#[cfg(any(feature = "v2017_13", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
bitflags! {
#[doc(alias = "OstreeChecksumFlags")]
pub struct ChecksumFlags: u32 {
#[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;
#[doc(alias = "OSTREE_CHECKSUM_FLAGS_CANONICAL_PERMISSIONS")]
const CANONICAL_PERMISSIONS = ffi::OSTREE_CHECKSUM_FLAGS_CANONICAL_PERMISSIONS as u32;
}
}
#[cfg(any(feature = "v2017_13", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
impl fmt::Display for ChecksumFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[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<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 {
#[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 IntoGlib for DiffFlags {
type GlibType = ffi::OstreeDiffFlags;
fn into_glib(self) -> ffi::OstreeDiffFlags {
self.bits()
}
}
#[doc(hidden)]
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 {
#[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 IntoGlib for GpgSignatureFormatFlags {
type GlibType = ffi::OstreeGpgSignatureFormatFlags;
fn into_glib(self) -> ffi::OstreeGpgSignatureFormatFlags {
self.bits()
}
}
#[doc(hidden)]
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 {
#[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 IntoGlib for RepoCommitModifierFlags {
type GlibType = ffi::OstreeRepoCommitModifierFlags;
fn into_glib(self) -> ffi::OstreeRepoCommitModifierFlags {
self.bits()
}
}
#[doc(hidden)]
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 {
#[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"))]
#[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)
}
}
#[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<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 {
#[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 IntoGlib for RepoCommitTraverseFlags {
type GlibType = ffi::OstreeRepoCommitTraverseFlags;
fn into_glib(self) -> ffi::OstreeRepoCommitTraverseFlags {
self.bits()
}
}
#[doc(hidden)]
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 {
#[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 IntoGlib for RepoListObjectsFlags {
type GlibType = ffi::OstreeRepoListObjectsFlags;
fn into_glib(self) -> ffi::OstreeRepoListObjectsFlags {
self.bits()
}
}
#[doc(hidden)]
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 {
#[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 IntoGlib for RepoListRefsExtFlags {
type GlibType = ffi::OstreeRepoListRefsExtFlags;
fn into_glib(self) -> ffi::OstreeRepoListRefsExtFlags {
self.bits()
}
}
#[doc(hidden)]
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 {
#[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 IntoGlib for RepoPruneFlags {
type GlibType = ffi::OstreeRepoPruneFlags;
fn into_glib(self) -> ffi::OstreeRepoPruneFlags {
self.bits()
}
}
#[doc(hidden)]
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 {
#[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 IntoGlib for RepoPullFlags {
type GlibType = ffi::OstreeRepoPullFlags;
fn into_glib(self) -> ffi::OstreeRepoPullFlags {
self.bits()
}
}
#[doc(hidden)]
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 {
#[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 IntoGlib for RepoResolveRevExtFlags {
type GlibType = ffi::OstreeRepoResolveRevExtFlags;
fn into_glib(self) -> ffi::OstreeRepoResolveRevExtFlags {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoResolveRevExtFlags> for RepoResolveRevExtFlags {
unsafe fn from_glib(value: ffi::OstreeRepoResolveRevExtFlags) -> Self {
Self::from_bits_truncate(value)
}
}
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
bitflags! {
#[doc(alias = "OstreeRepoVerifyFlags")]
pub struct RepoVerifyFlags: u32 {
#[doc(alias = "OSTREE_REPO_VERIFY_FLAGS_NONE")]
const NONE = ffi::OSTREE_REPO_VERIFY_FLAGS_NONE as u32;
#[doc(alias = "OSTREE_REPO_VERIFY_FLAGS_NO_GPG")]
const NO_GPG = ffi::OSTREE_REPO_VERIFY_FLAGS_NO_GPG as u32;
#[doc(alias = "OSTREE_REPO_VERIFY_FLAGS_NO_SIGNAPI")]
const NO_SIGNAPI = ffi::OSTREE_REPO_VERIFY_FLAGS_NO_SIGNAPI as u32;
}
}
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
impl fmt::Display for RepoVerifyFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
#[doc(hidden)]
impl IntoGlib for RepoVerifyFlags {
type GlibType = ffi::OstreeRepoVerifyFlags;
fn into_glib(self) -> ffi::OstreeRepoVerifyFlags {
self.bits()
}
}
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
#[doc(hidden)]
impl FromGlib<ffi::OstreeRepoVerifyFlags> for RepoVerifyFlags {
unsafe fn from_glib(value: ffi::OstreeRepoVerifyFlags) -> Self {
Self::from_bits_truncate(value)
}
}
bitflags! {
#[doc(alias = "OstreeSePolicyRestoreconFlags")]
pub struct SePolicyRestoreconFlags: u32 {
#[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 IntoGlib for SePolicyRestoreconFlags {
type GlibType = ffi::OstreeSePolicyRestoreconFlags;
fn into_glib(self) -> ffi::OstreeSePolicyRestoreconFlags {
self.bits()
}
}
#[doc(hidden)]
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 {
#[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 IntoGlib for SysrootSimpleWriteDeploymentFlags {
type GlibType = ffi::OstreeSysrootSimpleWriteDeploymentFlags;
fn into_glib(self) -> ffi::OstreeSysrootSimpleWriteDeploymentFlags {
self.bits()
}
}
#[doc(hidden)]
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 {
#[doc(alias = "OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED")]
const IGNORE_UNCONFIGURED = ffi::OSTREE_SYSROOT_UPGRADER_FLAGS_IGNORE_UNCONFIGURED as u32;
#[doc(alias = "OSTREE_SYSROOT_UPGRADER_FLAGS_STAGE")]
const STAGE = ffi::OSTREE_SYSROOT_UPGRADER_FLAGS_STAGE 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 IntoGlib for SysrootUpgraderFlags {
type GlibType = ffi::OstreeSysrootUpgraderFlags;
fn into_glib(self) -> ffi::OstreeSysrootUpgraderFlags {
self.bits()
}
}
#[doc(hidden)]
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(ffi::ostree_sysroot_upgrader_flags_get_type()) }
}
}
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 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
}
fn value_type(&self) -> glib::Type {
Self::static_type()
}
}
bitflags! {
#[doc(alias = "OstreeSysrootUpgraderPullFlags")]
pub struct SysrootUpgraderPullFlags: u32 {
#[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 IntoGlib for SysrootUpgraderPullFlags {
type GlibType = ffi::OstreeSysrootUpgraderPullFlags;
fn into_glib(self) -> ffi::OstreeSysrootUpgraderPullFlags {
self.bits()
}
}
#[doc(hidden)]
impl FromGlib<ffi::OstreeSysrootUpgraderPullFlags> for SysrootUpgraderPullFlags {
unsafe fn from_glib(value: ffi::OstreeSysrootUpgraderPullFlags) -> Self {
Self::from_bits_truncate(value)
}
}
+385
View File
@@ -0,0 +1,385 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
#[cfg(any(feature = "v2020_1", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_1")))]
use crate::CommitSizesEntry;
use crate::DiffFlags;
use crate::DiffItem;
use crate::ObjectType;
use glib::object::IsA;
use glib::translate::*;
use std::mem;
use std::ptr;
#[cfg(any(feature = "v2017_15", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_15")))]
#[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 _ = 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(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 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 ffi:ostree_checksum_bytes_peek_validate() }
//}
#[doc(alias = "ostree_checksum_from_bytes_v")]
pub fn checksum_from_bytes_v(csum_v: &glib::Variant) -> Option<glib::GString> {
unsafe {
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(ffi::ostree_checksum_to_bytes_v(checksum.to_glib_none().0))
}
}
#[cfg(any(feature = "v2018_2", feature = "dox"))]
#[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(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 _ = 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)) }
}
}
#[doc(alias = "ostree_commit_get_parent")]
pub fn commit_get_parent(commit_variant: &glib::Variant) -> Option<glib::GString> {
unsafe {
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 {
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 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 _ = 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 _ = 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 _ = 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(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 _ = 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 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 {
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(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(ffi::ostree_metadata_variant_type(objtype.into_glib()))
}
}
#[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();
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))
}
}
#[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();
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(ffi::ostree_object_name_serialize(checksum.to_glib_none().0, objtype.into_glib()))
}
}
#[doc(alias = "ostree_object_to_string")]
pub fn object_to_string(checksum: &str, objtype: ObjectType) -> Option<glib::GString> {
unsafe {
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(ffi::ostree_object_type_from_string(str.to_glib_none().0))
}
}
#[doc(alias = "ostree_object_type_to_string")]
pub fn object_type_to_string(objtype: ObjectType) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::ostree_object_type_to_string(objtype.into_glib()))
}
}
#[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 _ = 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 _ = 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 _ = 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 _ = 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 _ = 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 _ = 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 _ = 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 _ = 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 _ = 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 _ = 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 _ = 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 _ = 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 _ = 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 _ = 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 _ = ffi::ostree_validate_structureof_objtype(objtype, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
+90
View File
@@ -0,0 +1,90 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use crate::GpgSignatureFormatFlags;
use glib::translate::*;
use std::fmt;
use std::mem;
#[cfg(any(feature = "v2016_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_6")))]
use std::ptr;
glib::wrapper! {
#[doc(alias = "OstreeGpgVerifyResult")]
pub struct GpgVerifyResult(Object<ffi::OstreeGpgVerifyResult>);
match fn {
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 {
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 {
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 {
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 ffi:ostree_gpg_verify_result_get() }
//}
#[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_none(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(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 _ = 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 {
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 {
f.write_str("GpgVerifyResult")
}
}
+214
View File
@@ -0,0 +1,214 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
mod async_progress;
pub use self::async_progress::{AsyncProgress};
mod bootconfig_parser;
pub use self::bootconfig_parser::{BootconfigParser};
mod content_writer;
pub use self::content_writer::{ContentWriter};
mod deployment;
pub use self::deployment::{Deployment};
mod gpg_verify_result;
pub use self::gpg_verify_result::{GpgVerifyResult};
mod mutable_tree;
pub use self::mutable_tree::{MutableTree};
mod repo;
pub use self::repo::{Repo};
mod repo_file;
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"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
mod repo_finder_avahi;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[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"))]
#[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"))]
#[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"))]
#[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};
#[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};
mod sysroot;
pub use self::sysroot::{Sysroot};
mod sysroot_upgrader;
pub use self::sysroot_upgrader::{SysrootUpgrader};
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
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;
pub use self::repo_commit_modifier::RepoCommitModifier;
mod repo_dev_ino_cache;
pub use self::repo_dev_ino_cache::RepoDevInoCache;
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
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;
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;
pub use self::enums::RepoCommitFilterResult;
pub use self::enums::RepoCommitIterResult;
pub use self::enums::RepoMode;
pub use self::enums::RepoRemoteChange;
pub use self::enums::StaticDeltaGenerateOpt;
mod flags;
#[cfg(any(feature = "v2017_13", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
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;
pub use self::flags::RepoListRefsExtFlags;
pub use self::flags::RepoPruneFlags;
pub use self::flags::RepoPullFlags;
pub use self::flags::RepoResolveRevExtFlags;
#[cfg(any(feature = "v2021_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
pub use self::flags::RepoVerifyFlags;
pub use self::flags::SePolicyRestoreconFlags;
pub use self::flags::SysrootSimpleWriteDeploymentFlags;
pub use self::flags::SysrootUpgraderFlags;
pub use self::flags::SysrootUpgraderPullFlags;
pub mod functions;
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;
pub use self::constants::GPG_KEY_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;
pub use self::constants::TREE_GVARIANT_STRING;
#[doc(hidden)]
pub mod traits {
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
pub use super::repo_finder::RepoFinderExt;
#[cfg(any(feature = "v2020_2", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
pub use super::sign::SignExt;
}
+185
View File
@@ -0,0 +1,185 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
#[cfg(any(feature = "v2018_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_7")))]
use crate::Repo;
use glib::translate::*;
use std::fmt;
use std::ptr;
glib::wrapper! {
#[doc(alias = "OstreeMutableTree")]
pub struct MutableTree(Object<ffi::OstreeMutableTree, ffi::OstreeMutableTreeClass>);
match fn {
type_ => || ffi::ostree_mutable_tree_get_type(),
}
}
impl MutableTree {
#[doc(alias = "ostree_mutable_tree_new")]
pub fn new() -> MutableTree {
unsafe {
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(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 = "v2021_5", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_5")))]
#[doc(alias = "ostree_mutable_tree_new_from_commit")]
#[doc(alias = "new_from_commit")]
pub fn from_commit(repo: &Repo, rev: &str) -> Result<MutableTree, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ffi::ostree_mutable_tree_new_from_commit(repo.to_glib_none().0, rev.to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2018_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_7")))]
#[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)) }
}
}
}
impl Default for MutableTree {
fn default() -> Self {
Self::new()
}
}
impl fmt::Display for MutableTree {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("MutableTree")
}
}
+34
View File
@@ -0,0 +1,34 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use glib::translate::*;
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct Remote(Shared<ffi::OstreeRemote>);
match fn {
ref => |ptr| ffi::ostree_remote_ref(ptr),
unref => |ptr| ffi::ostree_remote_unref(ptr),
type_ => || ffi::ostree_remote_get_type(),
}
}
impl Remote {
#[doc(alias = "ostree_remote_get_name")]
#[doc(alias = "get_name")]
pub fn name(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::ostree_remote_get_name(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_remote_get_url")]
#[doc(alias = "get_url")]
pub fn url(&self) -> Option<glib::GString> {
unsafe {
from_glib_full(ffi::ostree_remote_get_url(self.to_glib_none().0))
}
}
}
+1343
View File
File diff suppressed because it is too large. Load diff
+107
View File
@@ -0,0 +1,107 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use crate::Repo;
use crate::RepoCommitFilterResult;
use crate::RepoCommitModifierFlags;
#[cfg(any(feature = "v2017_13", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_13")))]
use crate::RepoDevInoCache;
use crate::SePolicy;
#[cfg(any(feature = "v2020_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))]
use glib::object::IsA;
use glib::translate::*;
use std::boxed::Box as Box_;
#[cfg(any(feature = "v2020_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_4")))]
use std::ptr;
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct RepoCommitModifier(Shared<ffi::OstreeRepoCommitModifier>);
match fn {
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 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<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 {
callback(&repo, path.as_str(), &file_info)
} else {
panic!("cannot get closure...")
};
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::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(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 {
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 {
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 _ = 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 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<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::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 {
ffi::ostree_repo_commit_modifier_set_xattr_callback(self.to_glib_none().0, callback, destroy_call2, Box_::into_raw(super_callback0) as *mut _);
}
}
}
+31
View File
@@ -0,0 +1,31 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use glib::translate::*;
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct RepoDevInoCache(Shared<ffi::OstreeRepoDevInoCache>);
match fn {
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(ffi::ostree_repo_devino_cache_new())
}
}
}
impl Default for RepoDevInoCache {
fn default() -> Self {
Self::new()
}
}
+127
View File
@@ -0,0 +1,127 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use crate::Repo;
use glib::object::IsA;
use glib::translate::*;
use std::fmt;
use std::mem;
use std::ptr;
glib::wrapper! {
#[doc(alias = "OstreeRepoFile")]
pub struct RepoFile(Object<ffi::OstreeRepoFile, ffi::OstreeRepoFileClass>) @implements gio::File;
match fn {
type_ => || ffi::ostree_repo_file_get_type(),
}
}
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 _ = ffi::ostree_repo_file_ensure_resolved(self.to_glib_none().0, &mut error);
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
}
}
#[doc(alias = "ostree_repo_file_get_checksum")]
#[doc(alias = "get_checksum")]
pub fn checksum(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::ostree_repo_file_get_checksum(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_repo_file_get_repo")]
#[doc(alias = "get_repo")]
pub fn repo(&self) -> Option<Repo> {
unsafe {
from_glib_none(ffi::ostree_repo_file_get_repo(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_repo_file_get_root")]
#[doc(alias = "get_root")]
pub fn root(&self) -> Option<RepoFile> {
unsafe {
from_glib_none(ffi::ostree_repo_file_get_root(self.to_glib_none().0))
}
}
#[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 _ = 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)) }
}
}
#[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 = 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))
}
}
#[doc(alias = "ostree_repo_file_tree_get_contents")]
pub fn tree_get_contents(&self) -> Option<glib::Variant> {
unsafe {
from_glib_full(ffi::ostree_repo_file_tree_get_contents(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_repo_file_tree_get_contents_checksum")]
pub fn tree_get_contents_checksum(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::ostree_repo_file_tree_get_contents_checksum(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_repo_file_tree_get_metadata")]
pub fn tree_get_metadata(&self) -> Option<glib::Variant> {
unsafe {
from_glib_full(ffi::ostree_repo_file_tree_get_metadata(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_repo_file_tree_get_metadata_checksum")]
pub fn tree_get_metadata_checksum(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::ostree_repo_file_tree_get_metadata_checksum(self.to_glib_none().0))
}
}
#[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 _ = 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)) }
}
}
#[doc(alias = "ostree_repo_file_tree_set_metadata")]
pub fn tree_set_metadata(&self, checksum: &str, metadata: &glib::Variant) {
unsafe {
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 {
f.write_str("RepoFile")
}
}
+32
View File
@@ -0,0 +1,32 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use crate::RepoFinderResult;
use glib::object::IsA;
use glib::translate::*;
use std::fmt;
use std::ptr;
glib::wrapper! {
#[doc(alias = "OstreeRepoFinder")]
pub struct RepoFinder(Interface<ffi::OstreeRepoFinder, ffi::OstreeRepoFinderInterface>);
match fn {
type_ => || ffi::ostree_repo_finder_get_type(),
}
}
impl RepoFinder {}
pub const NONE_REPO_FINDER: Option<&RepoFinder> = None;
pub trait RepoFinderExt: 'static {}
impl<O: IsA<RepoFinder>> RepoFinderExt for O {}
impl fmt::Display for RepoFinder {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("RepoFinder")
}
}
+48
View File
@@ -0,0 +1,48 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use crate::RepoFinder;
use glib::translate::*;
use std::fmt;
use std::ptr;
glib::wrapper! {
#[doc(alias = "OstreeRepoFinderAvahi")]
pub struct RepoFinderAvahi(Object<ffi::OstreeRepoFinderAvahi, ffi::OstreeRepoFinderAvahiClass>) @implements RepoFinder;
match fn {
type_ => || ffi::ostree_repo_finder_avahi_get_type(),
}
}
impl RepoFinderAvahi {
#[doc(alias = "ostree_repo_finder_avahi_new")]
pub fn new(context: Option<&glib::MainContext>) -> RepoFinderAvahi {
unsafe {
from_glib_full(ffi::ostree_repo_finder_avahi_new(context.to_glib_none().0))
}
}
#[doc(alias = "ostree_repo_finder_avahi_start")]
pub fn start(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
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)) }
}
}
#[doc(alias = "ostree_repo_finder_avahi_stop")]
pub fn stop(&self) {
unsafe {
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 {
f.write_str("RepoFinderAvahi")
}
}
+39
View File
@@ -0,0 +1,39 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use crate::RepoFinder;
use glib::translate::*;
use std::fmt;
glib::wrapper! {
#[doc(alias = "OstreeRepoFinderConfig")]
pub struct RepoFinderConfig(Object<ffi::OstreeRepoFinderConfig, ffi::OstreeRepoFinderConfigClass>) @implements RepoFinder;
match fn {
type_ => || ffi::ostree_repo_finder_config_get_type(),
}
}
impl RepoFinderConfig {
#[doc(alias = "ostree_repo_finder_config_new")]
pub fn new() -> RepoFinderConfig {
unsafe {
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()
}
}
impl fmt::Display for RepoFinderConfig {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("RepoFinderConfig")
}
}
+44
View File
@@ -0,0 +1,44 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use crate::RepoFinder;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::translate::*;
use glib::StaticType;
use std::fmt;
glib::wrapper! {
#[doc(alias = "OstreeRepoFinderMount")]
pub struct RepoFinderMount(Object<ffi::OstreeRepoFinderMount, ffi::OstreeRepoFinderMountClass>) @implements RepoFinder;
match fn {
type_ => || ffi::ostree_repo_finder_mount_get_type(),
}
}
impl RepoFinderMount {
#[doc(alias = "ostree_repo_finder_mount_new")]
pub fn new<P: IsA<gio::VolumeMonitor>>(monitor: Option<&P>) -> RepoFinderMount {
unsafe {
from_glib_full(ffi::ostree_repo_finder_mount_new(monitor.map(|p| p.as_ref()).to_glib_none().0))
}
}
#[cfg(any(feature = "v2018_6", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
pub fn monitor(&self) -> Option<gio::VolumeMonitor> {
unsafe {
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")
}
}
}
impl fmt::Display for RepoFinderMount {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("RepoFinderMount")
}
}
+46
View File
@@ -0,0 +1,46 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use crate::RepoFinder;
use glib::translate::*;
use std::fmt;
glib::wrapper! {
#[doc(alias = "OstreeRepoFinderOverride")]
pub struct RepoFinderOverride(Object<ffi::OstreeRepoFinderOverride, ffi::OstreeRepoFinderOverrideClass>) @implements RepoFinder;
match fn {
type_ => || ffi::ostree_repo_finder_override_get_type(),
}
}
impl RepoFinderOverride {
#[doc(alias = "ostree_repo_finder_override_new")]
pub fn new() -> RepoFinderOverride {
unsafe {
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()
}
}
impl fmt::Display for RepoFinderOverride {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("RepoFinderOverride")
}
}
+54
View File
@@ -0,0 +1,54 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use std::cmp;
use glib::translate::ToGlibPtr;
glib::wrapper! {
#[derive(Debug, Hash)]
pub struct RepoFinderResult(Boxed<ffi::OstreeRepoFinderResult>);
match fn {
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 {
//#[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 ffi:ostree_repo_finder_result_new() }
//}
#[doc(alias = "ostree_repo_finder_result_compare")]
fn compare(&self, b: &RepoFinderResult) -> i32 {
unsafe {
ffi::ostree_repo_finder_result_compare(self.to_glib_none().0, b.to_glib_none().0)
}
}
}
impl PartialEq for RepoFinderResult {
#[inline]
fn eq(&self, other: &Self) -> bool {
self.compare(other) == 0
}
}
impl Eq for RepoFinderResult {}
impl PartialOrd for RepoFinderResult {
#[inline]
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
self.compare(other).partial_cmp(&0)
}
}
impl Ord for RepoFinderResult {
#[inline]
fn cmp(&self, other: &Self) -> cmp::Ordering {
self.compare(other).cmp(&0)
}
}
+126
View File
@@ -0,0 +1,126 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use crate::Repo;
use crate::SePolicyRestoreconFlags;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::translate::*;
use glib::StaticType;
use std::fmt;
use std::ptr;
glib::wrapper! {
#[doc(alias = "OstreeSePolicy")]
pub struct SePolicy(Object<ffi::OstreeSePolicy>);
match fn {
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 = 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 = 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)) }
}
}
#[doc(alias = "ostree_sepolicy_new_from_commit")]
#[doc(alias = "new_from_commit")]
pub fn from_commit<P: IsA<gio::Cancellable>>(repo: &Repo, rev: &str, cancellable: Option<&P>) -> Result<SePolicy, glib::Error> {
unsafe {
let mut error = ptr::null_mut();
let ret = ffi::ostree_sepolicy_new_from_commit(repo.to_glib_none().0, rev.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
}
#[cfg(any(feature = "v2016_5", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))]
#[doc(alias = "ostree_sepolicy_get_csum")]
#[doc(alias = "get_csum")]
pub fn csum(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::ostree_sepolicy_get_csum(self.to_glib_none().0))
}
}
#[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 _ = 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)) }
}
}
#[doc(alias = "ostree_sepolicy_get_name")]
#[doc(alias = "get_name")]
pub fn name(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::ostree_sepolicy_get_name(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_sepolicy_get_path")]
#[doc(alias = "get_path")]
pub fn path(&self) -> Option<gio::File> {
unsafe {
from_glib_none(ffi::ostree_sepolicy_get_path(self.to_glib_none().0))
}
}
#[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 _ = 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 _ = 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)) }
}
}
#[doc(alias = "rootfs-dfd")]
pub fn rootfs_dfd(&self) -> i32 {
unsafe {
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")
}
}
}
unsafe impl Send for SePolicy {}
impl fmt::Display for SePolicy {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("SePolicy")
}
}
+191
View File
@@ -0,0 +1,191 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use crate::Repo;
use glib::object::IsA;
use glib::translate::*;
use std::fmt;
use std::ptr;
glib::wrapper! {
#[doc(alias = "OstreeSign")]
pub struct Sign(Interface<ffi::OstreeSign, ffi::OstreeSignInterface>);
match fn {
type_ => || ffi::ostree_sign_get_type(),
}
}
impl Sign {
#[doc(alias = "ostree_sign_get_all")]
#[doc(alias = "get_all")]
pub fn all() -> Vec<Sign> {
unsafe {
FromGlibPtrContainer::from_glib_full(ffi::ostree_sign_get_all())
}
}
#[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 = ffi::ostree_sign_get_by_name(name.to_glib_none().0, &mut error);
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
}
}
}
pub const NONE_SIGN: Option<&Sign> = None;
pub trait SignExt: 'static {
#[doc(alias = "ostree_sign_add_pk")]
fn add_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error>;
#[doc(alias = "ostree_sign_clear_keys")]
fn clear_keys(&self) -> Result<(), glib::Error>;
#[doc(alias = "ostree_sign_commit")]
fn commit<P: IsA<gio::Cancellable>>(&self, repo: &Repo, commit_checksum: &str, cancellable: Option<&P>) -> Result<(), 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>;
#[doc(alias = "ostree_sign_data")]
fn data<P: IsA<gio::Cancellable>>(&self, data: &glib::Bytes, cancellable: Option<&P>) -> Result<glib::Bytes, glib::Error>;
#[doc(alias = "ostree_sign_data_verify")]
fn data_verify(&self, data: &glib::Bytes, signatures: &glib::Variant) -> Result<Option<glib::GString>, glib::Error>;
#[doc(alias = "ostree_sign_get_name")]
#[doc(alias = "get_name")]
fn name(&self) -> Option<glib::GString>;
#[doc(alias = "ostree_sign_load_pk")]
fn load_pk(&self, options: &glib::Variant) -> Result<(), glib::Error>;
#[doc(alias = "ostree_sign_metadata_format")]
fn metadata_format(&self) -> Option<glib::GString>;
#[doc(alias = "ostree_sign_metadata_key")]
fn metadata_key(&self) -> Option<glib::GString>;
#[doc(alias = "ostree_sign_set_pk")]
fn set_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error>;
#[doc(alias = "ostree_sign_set_sk")]
fn set_sk(&self, secret_key: &glib::Variant) -> Result<(), glib::Error>;
#[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 {
fn add_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
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)) }
}
}
fn clear_keys(&self) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
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)) }
}
}
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 _ = 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)) }
}
}
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 _ = 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)) }
}
}
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 _ = 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)) }
}
}
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 _ = 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)) }
}
}
fn name(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::ostree_sign_get_name(self.as_ref().to_glib_none().0))
}
}
fn load_pk(&self, options: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
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)) }
}
}
fn metadata_format(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::ostree_sign_metadata_format(self.as_ref().to_glib_none().0))
}
}
fn metadata_key(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::ostree_sign_metadata_key(self.as_ref().to_glib_none().0))
}
}
fn set_pk(&self, public_key: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
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)) }
}
}
fn set_sk(&self, secret_key: &glib::Variant) -> Result<(), glib::Error> {
unsafe {
let mut error = ptr::null_mut();
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)) }
}
}
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 _ = 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)) }
}
}
}
impl fmt::Display for Sign {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Sign")
}
}
+509
View File
@@ -0,0 +1,509 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use crate::Deployment;
#[cfg(any(feature = "v2016_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
use crate::DeploymentUnlockedState;
#[cfg(any(feature = "v2017_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))]
use crate::Repo;
#[cfg(any(feature = "v2020_7", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_7")))]
use crate::SysrootDeployTreeOpts;
use crate::SysrootSimpleWriteDeploymentFlags;
#[cfg(any(feature = "v2017_4", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_4")))]
use crate::SysrootWriteDeploymentsOpts;
use glib::object::IsA;
#[cfg(any(feature = "v2017_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))]
use glib::object::ObjectType as ObjectType_;
#[cfg(any(feature = "v2017_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))]
use glib::signal::connect_raw;
#[cfg(any(feature = "v2017_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))]
use glib::signal::SignalHandlerId;
use glib::translate::*;
use std::boxed::Box as Box_;
use std::fmt;
use std::mem;
#[cfg(any(feature = "v2017_10", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_10")))]
use std::mem::transmute;
use std::pin::Pin;
use std::ptr;
glib::wrapper! {
#[doc(alias = "OstreeSysroot")]
pub struct Sysroot(Object<ffi::OstreeSysroot>);
match fn {
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(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(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 _ = 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 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 _ = 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 _ = 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 _ = 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 _ = 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 _ = 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 _ = 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 _ = 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)) }
}
}
#[doc(alias = "ostree_sysroot_get_booted_deployment")]
#[doc(alias = "get_booted_deployment")]
pub fn booted_deployment(&self) -> Option<Deployment> {
unsafe {
from_glib_none(ffi::ostree_sysroot_get_booted_deployment(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_sysroot_get_bootversion")]
#[doc(alias = "get_bootversion")]
pub fn bootversion(&self) -> i32 {
unsafe {
ffi::ostree_sysroot_get_bootversion(self.to_glib_none().0)
}
}
#[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(ffi::ostree_sysroot_get_deployment_directory(self.to_glib_none().0, deployment.to_glib_none().0))
}
}
#[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(ffi::ostree_sysroot_get_deployment_dirpath(self.to_glib_none().0, deployment.to_glib_none().0))
}
}
#[doc(alias = "ostree_sysroot_get_deployments")]
#[doc(alias = "get_deployments")]
pub fn deployments(&self) -> Vec<Deployment> {
unsafe {
FromGlibPtrContainer::from_glib_container(ffi::ostree_sysroot_get_deployments(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_sysroot_get_fd")]
#[doc(alias = "get_fd")]
pub fn fd(&self) -> i32 {
unsafe {
ffi::ostree_sysroot_get_fd(self.to_glib_none().0)
}
}
#[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(ffi::ostree_sysroot_get_merge_deployment(self.to_glib_none().0, osname.to_glib_none().0))
}
}
#[doc(alias = "ostree_sysroot_get_path")]
#[doc(alias = "get_path")]
pub fn path(&self) -> Option<gio::File> {
unsafe {
from_glib_none(ffi::ostree_sysroot_get_path(self.to_glib_none().0))
}
}
#[cfg(any(feature = "v2018_5", feature = "dox"))]
#[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(ffi::ostree_sysroot_get_staged_deployment(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_sysroot_get_subbootversion")]
#[doc(alias = "get_subbootversion")]
pub fn subbootversion(&self) -> i32 {
unsafe {
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 _ = 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 _ = 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(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 _ = 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 _ = 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 _ = 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 glib::gobject_ffi::GObject, res: *mut gio::ffi::GAsyncResult, user_data: glib::ffi::gpointer) {
let mut error = ptr::null_mut();
let _ = ffi::ostree_sysroot_lock_finish(_source_object as *mut _, res, &mut error);
let result = if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) };
let callback: Box_<Q> = Box_::from_raw(user_data as *mut _);
callback(result);
}
let callback = lock_async_trampoline::<Q>;
unsafe {
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, cancellable, send| {
obj.lock_async(
Some(cancellable),
move |res| {
send.resolve(res);
},
);
}))
}
#[doc(alias = "ostree_sysroot_origin_new_from_refspec")]
pub fn origin_new_from_refspec(&self, refspec: &str) -> Option<glib::KeyFile> {
unsafe {
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 _ = 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();
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(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 = 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 {
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 _ = 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"))]
#[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 _ = 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 _ = 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 _ = 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 _ = 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 {
ffi::ostree_sysroot_unload(self.to_glib_none().0);
}
}
#[doc(alias = "ostree_sysroot_unlock")]
pub fn unlock(&self) {
unsafe {
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 _ = 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 _ = 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 _ = 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)) }
}
}
#[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(ffi::ostree_sysroot_get_deployment_origin_path(deployment_path.as_ref().to_glib_none().0))
}
}
#[cfg(any(feature = "v2017_10", feature = "dox"))]
#[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), &glib::GString::from_glib_borrow(msg))
}
unsafe {
let f: Box_<F> = Box_::new(f);
connect_raw(self.as_ptr() as *mut _, b"journal-msg\0".as_ptr() as *const _,
Some(transmute::<_, unsafe extern "C" fn()>(journal_msg_trampoline::<F> as *const ())), Box_::into_raw(f))
}
}
}
impl fmt::Display for Sysroot {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("Sysroot")
}
}
+159
View File
@@ -0,0 +1,159 @@
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files
// DO NOT EDIT
use crate::AsyncProgress;
use crate::Repo;
use crate::RepoPullFlags;
use crate::Sysroot;
use crate::SysrootUpgraderFlags;
use crate::SysrootUpgraderPullFlags;
use glib::object::IsA;
use glib::object::ObjectType as ObjectType_;
use glib::translate::*;
use glib::StaticType;
use std::fmt;
use std::mem;
use std::ptr;
glib::wrapper! {
#[doc(alias = "OstreeSysrootUpgrader")]
pub struct SysrootUpgrader(Object<ffi::OstreeSysrootUpgrader>);
match fn {
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 = 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)) }
}
}
#[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 = 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)) }
}
}
#[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 = 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 _ = 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(ffi::ostree_sysroot_upgrader_dup_origin(self.to_glib_none().0))
}
}
#[doc(alias = "ostree_sysroot_upgrader_get_origin")]
#[doc(alias = "get_origin")]
pub fn origin(&self) -> Option<glib::KeyFile> {
unsafe {
from_glib_none(ffi::ostree_sysroot_upgrader_get_origin(self.to_glib_none().0))
}
}
#[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(ffi::ostree_sysroot_upgrader_get_origin_description(self.to_glib_none().0))
}
}
#[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 _ = 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)) }
}
}
#[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 _ = 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 _ = 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 flags(&self) -> SysrootUpgraderFlags {
unsafe {
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 osname(&self) -> Option<glib::GString> {
unsafe {
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 sysroot(&self) -> Option<Sysroot> {
unsafe {
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 _ = 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)) }
}
}
}
impl fmt::Display for SysrootUpgrader {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("SysrootUpgrader")
}
}
+2
View File
@@ -0,0 +1,2 @@
Generated by gir (https://github.com/gtk-rs/gir @ e8f82cf6)
from gir-files