Add as much of Repo as easily possible
This commit is contained in:
parent
62f8310dea
commit
19fef71592
|
|
@ -4,20 +4,48 @@ library = "OSTree"
|
|||
version = "1.0"
|
||||
target_path = "../libostree"
|
||||
deprecate_by_min_version = true
|
||||
single_version_file = true
|
||||
|
||||
girs_dir = "../gir-files"
|
||||
|
||||
generate = [
|
||||
"OSTree.RepoMode",
|
||||
"OSTree.AsyncProgress",
|
||||
"OSTree.CollectionRef",
|
||||
"OSTree.GpgSignatureFormatFlags",
|
||||
"OSTree.GpgVerifyResult",
|
||||
"OSTree.ObjectType",
|
||||
"OSTree.Remote",
|
||||
"OSTree.RepoCheckoutMode",
|
||||
"OSTree.RepoCheckoutOverwriteMode",
|
||||
"OSTree.RepoCommitModifier",
|
||||
"OSTree.RepoCommitState",
|
||||
"OSTree.RepoDevInoCache",
|
||||
"OSTree.RepoMode",
|
||||
"OSTree.RepoPruneFlags",
|
||||
"OSTree.RepoPullFlags",
|
||||
"OSTree.RepoRemoteChange",
|
||||
"OSTree.RepoResolveRevExtFlags",
|
||||
"OSTree.RepoTransactionStats",
|
||||
"OSTree.SePolicy",
|
||||
"OSTree.SePolicyRestoreconFlags",
|
||||
"OSTree.StaticDeltaGenerateOpt",
|
||||
|
||||
#"OSTree.RepoPruneOptions",
|
||||
#"OSTree.RepoExportArchiveOptions",
|
||||
#"OSTree.RepoCheckoutOptions",
|
||||
#"OSTree.RepoCheckoutAtOptions",
|
||||
]
|
||||
|
||||
manual = [
|
||||
"GLib.Error",
|
||||
"GLib.Variant",
|
||||
"Gio.Cancellable",
|
||||
"Gio.File",
|
||||
"Gio.FileInfo",
|
||||
"Gio.FileQueryInfoFlags",
|
||||
"Gio.InputStream",
|
||||
"GLib.Bytes",
|
||||
"GLib.Error",
|
||||
"GLib.KeyFile",
|
||||
"GLib.String",
|
||||
"GLib.Variant",
|
||||
]
|
||||
|
||||
[[object]]
|
||||
|
|
@ -27,12 +55,33 @@ status = "generate"
|
|||
pattern = ".+_async"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
pattern = "checkout_at"
|
||||
[[object.function.parameter]]
|
||||
name = "options"
|
||||
const = true
|
||||
|
||||
[[object.function]]
|
||||
pattern = "mode_from_string"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
pattern = "remote_gpg_import"
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "OSTree.RepoFile"
|
||||
status = "generate"
|
||||
[[object.function]]
|
||||
pattern = "get_xattrs"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
pattern = "tree_find_child"
|
||||
ignore = true
|
||||
|
||||
[[object.function]]
|
||||
pattern = "tree_query_child"
|
||||
ignore = true
|
||||
|
||||
[[object]]
|
||||
name = "OSTree.MutableTree"
|
||||
status = "generate"
|
||||
[[object.function]]
|
||||
pattern = "lookup"
|
||||
ignore = true
|
||||
|
||||
|
|
|
|||
|
|
@ -82,10 +82,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
name = "libostree"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gio 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gio-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libostree-sys 0.2.0",
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,11 @@ version = "0.2.0"
|
|||
name = "libostree"
|
||||
|
||||
[dependencies]
|
||||
libc = "^0.2.0"
|
||||
bitflags = "^1.0.0"
|
||||
glib = "^0.6.0"
|
||||
gio = "^0.5.0"
|
||||
glib-sys = "^0.7"
|
||||
gobject-sys = "^0.7"
|
||||
gio-sys = "^0.7"
|
||||
libostree-sys = { path = "../libostree-sys" }
|
||||
|
|
|
|||
|
|
@ -0,0 +1,161 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct AsyncProgress(Object<ffi::OstreeAsyncProgress, ffi::OstreeAsyncProgressClass>);
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ostree_async_progress_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl AsyncProgress {
|
||||
pub fn new() -> AsyncProgress {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ostree_async_progress_new())
|
||||
}
|
||||
}
|
||||
|
||||
//pub fn new_and_connect<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(changed: P, user_data: Q) -> AsyncProgress {
|
||||
// unsafe { TODO: call ffi::ostree_async_progress_new_and_connect() }
|
||||
//}
|
||||
}
|
||||
|
||||
impl Default for AsyncProgress {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait AsyncProgressExt {
|
||||
fn finish(&self);
|
||||
|
||||
//#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
//fn get(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
fn get_status(&self) -> Option<String>;
|
||||
|
||||
fn get_uint(&self, key: &str) -> u32;
|
||||
|
||||
fn get_uint64(&self, key: &str) -> u64;
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
fn get_variant(&self, key: &str) -> Option<glib::Variant>;
|
||||
|
||||
//#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
//fn set(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs);
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
fn set_status<'a, P: Into<Option<&'a str>>>(&self, status: P);
|
||||
|
||||
fn set_uint(&self, key: &str, value: u32);
|
||||
|
||||
fn set_uint64(&self, key: &str, value: u64);
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
fn set_variant(&self, key: &str, value: &glib::Variant);
|
||||
|
||||
fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<AsyncProgress> + IsA<glib::object::Object>> AsyncProgressExt for O {
|
||||
fn finish(&self) {
|
||||
unsafe {
|
||||
ffi::ostree_async_progress_finish(self.to_glib_none().0);
|
||||
}
|
||||
}
|
||||
|
||||
//#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
//fn get(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call ffi::ostree_async_progress_get() }
|
||||
//}
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
fn get_status(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ostree_async_progress_get_status(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_uint(&self, key: &str) -> u32 {
|
||||
unsafe {
|
||||
ffi::ostree_async_progress_get_uint(self.to_glib_none().0, key.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn get_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"))]
|
||||
fn get_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"))]
|
||||
//fn set(&self, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) {
|
||||
// unsafe { TODO: call ffi::ostree_async_progress_set() }
|
||||
//}
|
||||
|
||||
#[cfg(any(feature = "v2017_6", feature = "dox"))]
|
||||
fn set_status<'a, P: Into<Option<&'a str>>>(&self, status: P) {
|
||||
let status = status.into();
|
||||
let status = status.to_glib_none();
|
||||
unsafe {
|
||||
ffi::ostree_async_progress_set_status(self.to_glib_none().0, status.0);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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"))]
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "changed",
|
||||
transmute(changed_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn changed_trampoline<P>(this: *mut ffi::OstreeAsyncProgress, f: glib_ffi::gpointer)
|
||||
where P: IsA<AsyncProgress> {
|
||||
let f: &&(Fn(&P) + 'static) = transmute(f);
|
||||
f(&AsyncProgress::from_glib_borrow(this).downcast_unchecked())
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::hash;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
#[derive(Debug, PartialOrd, Ord)]
|
||||
pub struct CollectionRef(Boxed<ffi::OstreeCollectionRef>);
|
||||
|
||||
match fn {
|
||||
copy => |ptr| gobject_ffi::g_boxed_copy(ffi::ostree_collection_ref_get_type(), ptr as *mut _) as *mut ffi::OstreeCollectionRef,
|
||||
free => |ptr| gobject_ffi::g_boxed_free(ffi::ostree_collection_ref_get_type(), ptr as *mut _),
|
||||
get_type => || ffi::ostree_collection_ref_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl CollectionRef {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub fn new<'a, P: Into<Option<&'a str>>>(collection_id: P, ref_name: &str) -> CollectionRef {
|
||||
let collection_id = collection_id.into();
|
||||
let collection_id = collection_id.to_glib_none();
|
||||
unsafe {
|
||||
from_glib_full(ffi::ostree_collection_ref_new(collection_id.0, ref_name.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub fn dup(&self) -> Option<CollectionRef> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ostree_collection_ref_dup(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub fn dupv(refs: &[&CollectionRef]) -> Vec<CollectionRef> {
|
||||
unsafe {
|
||||
FromGlibPtrContainer::from_glib_full(ffi::ostree_collection_ref_dupv(refs.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn equal<'a, P: Into<Option<&'a CollectionRef>>>(&self, ref2: P) -> bool {
|
||||
unsafe {
|
||||
from_glib(ffi::ostree_collection_ref_equal(ToGlibPtr::<*mut ffi::OstreeCollectionRef>::to_glib_none(self).0 as glib_ffi::gconstpointer, ToGlibPtr::<*mut ffi::OstreeCollectionRef>::to_glib_none(ref2).0 as glib_ffi::gconstpointer))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub fn freev(refs: &[&CollectionRef]) {
|
||||
unsafe {
|
||||
ffi::ostree_collection_ref_freev(refs.to_glib_full());
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn hash(&self) -> u32 {
|
||||
unsafe {
|
||||
ffi::ostree_collection_ref_hash(ToGlibPtr::<*mut 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)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,40 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum GpgSignatureFormatFlags {
|
||||
GpgSignatureFormatDefault,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for GpgSignatureFormatFlags {
|
||||
type GlibType = ffi::OstreeGpgSignatureFormatFlags;
|
||||
|
||||
fn to_glib(&self) -> ffi::OstreeGpgSignatureFormatFlags {
|
||||
match *self {
|
||||
GpgSignatureFormatFlags::GpgSignatureFormatDefault => ffi::OSTREE_GPG_SIGNATURE_FORMAT_DEFAULT,
|
||||
GpgSignatureFormatFlags::__Unknown(value) => value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::OstreeGpgSignatureFormatFlags> for GpgSignatureFormatFlags {
|
||||
fn from_glib(value: ffi::OstreeGpgSignatureFormatFlags) -> Self {
|
||||
match value {
|
||||
0 => GpgSignatureFormatFlags::GpgSignatureFormatDefault,
|
||||
value => GpgSignatureFormatFlags::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum ObjectType {
|
||||
|
|
@ -53,6 +83,78 @@ impl FromGlib<ffi::OstreeObjectType> for ObjectType {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum RepoCheckoutMode {
|
||||
None,
|
||||
User,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCheckoutMode {
|
||||
type GlibType = ffi::OstreeRepoCheckoutMode;
|
||||
|
||||
fn to_glib(&self) -> ffi::OstreeRepoCheckoutMode {
|
||||
match *self {
|
||||
RepoCheckoutMode::None => ffi::OSTREE_REPO_CHECKOUT_MODE_NONE,
|
||||
RepoCheckoutMode::User => ffi::OSTREE_REPO_CHECKOUT_MODE_USER,
|
||||
RepoCheckoutMode::__Unknown(value) => value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::OstreeRepoCheckoutMode> for RepoCheckoutMode {
|
||||
fn from_glib(value: ffi::OstreeRepoCheckoutMode) -> Self {
|
||||
match value {
|
||||
0 => RepoCheckoutMode::None,
|
||||
1 => RepoCheckoutMode::User,
|
||||
value => RepoCheckoutMode::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum RepoCheckoutOverwriteMode {
|
||||
None,
|
||||
UnionFiles,
|
||||
AddFiles,
|
||||
UnionIdentical,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCheckoutOverwriteMode {
|
||||
type GlibType = ffi::OstreeRepoCheckoutOverwriteMode;
|
||||
|
||||
fn to_glib(&self) -> ffi::OstreeRepoCheckoutOverwriteMode {
|
||||
match *self {
|
||||
RepoCheckoutOverwriteMode::None => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_NONE,
|
||||
RepoCheckoutOverwriteMode::UnionFiles => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_FILES,
|
||||
RepoCheckoutOverwriteMode::AddFiles => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_ADD_FILES,
|
||||
RepoCheckoutOverwriteMode::UnionIdentical => ffi::OSTREE_REPO_CHECKOUT_OVERWRITE_UNION_IDENTICAL,
|
||||
RepoCheckoutOverwriteMode::__Unknown(value) => value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::OstreeRepoCheckoutOverwriteMode> for RepoCheckoutOverwriteMode {
|
||||
fn from_glib(value: ffi::OstreeRepoCheckoutOverwriteMode) -> Self {
|
||||
match value {
|
||||
0 => RepoCheckoutOverwriteMode::None,
|
||||
1 => RepoCheckoutOverwriteMode::UnionFiles,
|
||||
2 => RepoCheckoutOverwriteMode::AddFiles,
|
||||
3 => RepoCheckoutOverwriteMode::UnionIdentical,
|
||||
value => RepoCheckoutOverwriteMode::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum RepoMode {
|
||||
|
|
@ -92,3 +194,141 @@ impl FromGlib<ffi::OstreeRepoMode> for RepoMode {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum RepoPruneFlags {
|
||||
None,
|
||||
NoPrune,
|
||||
RefsOnly,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoPruneFlags {
|
||||
type GlibType = ffi::OstreeRepoPruneFlags;
|
||||
|
||||
fn to_glib(&self) -> ffi::OstreeRepoPruneFlags {
|
||||
match *self {
|
||||
RepoPruneFlags::None => ffi::OSTREE_REPO_PRUNE_FLAGS_NONE,
|
||||
RepoPruneFlags::NoPrune => ffi::OSTREE_REPO_PRUNE_FLAGS_NO_PRUNE,
|
||||
RepoPruneFlags::RefsOnly => ffi::OSTREE_REPO_PRUNE_FLAGS_REFS_ONLY,
|
||||
RepoPruneFlags::__Unknown(value) => value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::OstreeRepoPruneFlags> for RepoPruneFlags {
|
||||
fn from_glib(value: ffi::OstreeRepoPruneFlags) -> Self {
|
||||
match value {
|
||||
0 => RepoPruneFlags::None,
|
||||
1 => RepoPruneFlags::NoPrune,
|
||||
2 => RepoPruneFlags::RefsOnly,
|
||||
value => RepoPruneFlags::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum RepoRemoteChange {
|
||||
Add,
|
||||
AddIfNotExists,
|
||||
Delete,
|
||||
DeleteIfExists,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoRemoteChange {
|
||||
type GlibType = ffi::OstreeRepoRemoteChange;
|
||||
|
||||
fn to_glib(&self) -> ffi::OstreeRepoRemoteChange {
|
||||
match *self {
|
||||
RepoRemoteChange::Add => ffi::OSTREE_REPO_REMOTE_CHANGE_ADD,
|
||||
RepoRemoteChange::AddIfNotExists => ffi::OSTREE_REPO_REMOTE_CHANGE_ADD_IF_NOT_EXISTS,
|
||||
RepoRemoteChange::Delete => ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE,
|
||||
RepoRemoteChange::DeleteIfExists => ffi::OSTREE_REPO_REMOTE_CHANGE_DELETE_IF_EXISTS,
|
||||
RepoRemoteChange::__Unknown(value) => value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::OstreeRepoRemoteChange> for RepoRemoteChange {
|
||||
fn from_glib(value: ffi::OstreeRepoRemoteChange) -> Self {
|
||||
match value {
|
||||
0 => RepoRemoteChange::Add,
|
||||
1 => RepoRemoteChange::AddIfNotExists,
|
||||
2 => RepoRemoteChange::Delete,
|
||||
3 => RepoRemoteChange::DeleteIfExists,
|
||||
value => RepoRemoteChange::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum RepoResolveRevExtFlags {
|
||||
RepoResolveRevExtNone,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoResolveRevExtFlags {
|
||||
type GlibType = ffi::OstreeRepoResolveRevExtFlags;
|
||||
|
||||
fn to_glib(&self) -> ffi::OstreeRepoResolveRevExtFlags {
|
||||
match *self {
|
||||
RepoResolveRevExtFlags::RepoResolveRevExtNone => ffi::OSTREE_REPO_RESOLVE_REV_EXT_NONE,
|
||||
RepoResolveRevExtFlags::__Unknown(value) => value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::OstreeRepoResolveRevExtFlags> for RepoResolveRevExtFlags {
|
||||
fn from_glib(value: ffi::OstreeRepoResolveRevExtFlags) -> Self {
|
||||
match value {
|
||||
0 => RepoResolveRevExtFlags::RepoResolveRevExtNone,
|
||||
value => RepoResolveRevExtFlags::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||
#[derive(Clone, Copy)]
|
||||
pub enum StaticDeltaGenerateOpt {
|
||||
Lowlatency,
|
||||
Major,
|
||||
#[doc(hidden)]
|
||||
__Unknown(i32),
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for StaticDeltaGenerateOpt {
|
||||
type GlibType = ffi::OstreeStaticDeltaGenerateOpt;
|
||||
|
||||
fn to_glib(&self) -> ffi::OstreeStaticDeltaGenerateOpt {
|
||||
match *self {
|
||||
StaticDeltaGenerateOpt::Lowlatency => ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_LOWLATENCY,
|
||||
StaticDeltaGenerateOpt::Major => ffi::OSTREE_STATIC_DELTA_GENERATE_OPT_MAJOR,
|
||||
StaticDeltaGenerateOpt::__Unknown(value) => value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::OstreeStaticDeltaGenerateOpt> for StaticDeltaGenerateOpt {
|
||||
fn from_glib(value: ffi::OstreeStaticDeltaGenerateOpt) -> Self {
|
||||
match value {
|
||||
0 => StaticDeltaGenerateOpt::Lowlatency,
|
||||
1 => StaticDeltaGenerateOpt::Major,
|
||||
value => StaticDeltaGenerateOpt::__Unknown(value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,84 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
bitflags! {
|
||||
pub struct RepoCommitState: u32 {
|
||||
const NORMAL = 0;
|
||||
const PARTIAL = 1;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoCommitState {
|
||||
type GlibType = ffi::OstreeRepoCommitState;
|
||||
|
||||
fn to_glib(&self) -> ffi::OstreeRepoCommitState {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::OstreeRepoCommitState> for RepoCommitState {
|
||||
fn from_glib(value: ffi::OstreeRepoCommitState) -> RepoCommitState {
|
||||
RepoCommitState::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
pub struct RepoPullFlags: u32 {
|
||||
const NONE = 0;
|
||||
const MIRROR = 1;
|
||||
const COMMIT_ONLY = 2;
|
||||
const UNTRUSTED = 4;
|
||||
const BAREUSERONLY_FILES = 8;
|
||||
const TRUSTED_HTTP = 16;
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for RepoPullFlags {
|
||||
type GlibType = ffi::OstreeRepoPullFlags;
|
||||
|
||||
fn to_glib(&self) -> ffi::OstreeRepoPullFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::OstreeRepoPullFlags> for RepoPullFlags {
|
||||
fn from_glib(value: ffi::OstreeRepoPullFlags) -> RepoPullFlags {
|
||||
RepoPullFlags::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
pub struct SePolicyRestoreconFlags: u32 {
|
||||
const NONE = 0;
|
||||
const ALLOW_NOLABEL = 1;
|
||||
const KEEP_EXISTING = 2;
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl ToGlib for SePolicyRestoreconFlags {
|
||||
type GlibType = ffi::OstreeSePolicyRestoreconFlags;
|
||||
|
||||
fn to_glib(&self) -> ffi::OstreeSePolicyRestoreconFlags {
|
||||
self.bits()
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
impl FromGlib<ffi::OstreeSePolicyRestoreconFlags> for SePolicyRestoreconFlags {
|
||||
fn from_glib(value: ffi::OstreeSePolicyRestoreconFlags) -> SePolicyRestoreconFlags {
|
||||
SePolicyRestoreconFlags::from_bits_truncate(value)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,96 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Error;
|
||||
use GpgSignatureFormatFlags;
|
||||
use ffi;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct GpgVerifyResult(Object<ffi::OstreeGpgVerifyResult>);
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ostree_gpg_verify_result_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl GpgVerifyResult {
|
||||
pub fn describe_variant<'a, P: Into<Option<&'a str>>>(variant: &glib::Variant, output_buffer: &mut glib::String, line_prefix: P, flags: GpgSignatureFormatFlags) {
|
||||
let line_prefix = line_prefix.into();
|
||||
let line_prefix = line_prefix.to_glib_none();
|
||||
unsafe {
|
||||
ffi::ostree_gpg_verify_result_describe_variant(variant.to_glib_none().0, output_buffer.to_glib_none_mut().0, line_prefix.0, flags.to_glib());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub trait GpgVerifyResultExt {
|
||||
fn count_all(&self) -> u32;
|
||||
|
||||
fn count_valid(&self) -> u32;
|
||||
|
||||
fn describe<'a, P: Into<Option<&'a str>>>(&self, signature_index: u32, output_buffer: &mut glib::String, line_prefix: P, flags: GpgSignatureFormatFlags);
|
||||
|
||||
//fn get(&self, signature_index: u32, attrs: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 26 }) -> Option<glib::Variant>;
|
||||
|
||||
fn get_all(&self, signature_index: u32) -> Option<glib::Variant>;
|
||||
|
||||
fn lookup(&self, key_id: &str) -> Option<u32>;
|
||||
|
||||
fn require_valid_signature(&self) -> Result<(), Error>;
|
||||
}
|
||||
|
||||
impl<O: IsA<GpgVerifyResult>> GpgVerifyResultExt for O {
|
||||
fn count_all(&self) -> u32 {
|
||||
unsafe {
|
||||
ffi::ostree_gpg_verify_result_count_all(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn count_valid(&self) -> u32 {
|
||||
unsafe {
|
||||
ffi::ostree_gpg_verify_result_count_valid(self.to_glib_none().0)
|
||||
}
|
||||
}
|
||||
|
||||
fn describe<'a, P: Into<Option<&'a str>>>(&self, signature_index: u32, output_buffer: &mut glib::String, line_prefix: P, flags: GpgSignatureFormatFlags) {
|
||||
let line_prefix = line_prefix.into();
|
||||
let line_prefix = line_prefix.to_glib_none();
|
||||
unsafe {
|
||||
ffi::ostree_gpg_verify_result_describe(self.to_glib_none().0, signature_index, output_buffer.to_glib_none_mut().0, line_prefix.0, flags.to_glib());
|
||||
}
|
||||
}
|
||||
|
||||
//fn get(&self, signature_index: u32, attrs: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 26 }) -> Option<glib::Variant> {
|
||||
// unsafe { TODO: call ffi::ostree_gpg_verify_result_get() }
|
||||
//}
|
||||
|
||||
fn get_all(&self, signature_index: u32) -> Option<glib::Variant> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ostree_gpg_verify_result_get_all(self.to_glib_none().0, signature_index))
|
||||
}
|
||||
}
|
||||
|
||||
fn lookup(&self, key_id: &str) -> Option<u32> {
|
||||
unsafe {
|
||||
let mut out_signature_index = mem::uninitialized();
|
||||
let ret = from_glib(ffi::ostree_gpg_verify_result_lookup(self.to_glib_none().0, key_id.to_glib_none().0, &mut out_signature_index));
|
||||
if ret { Some(out_signature_index) } else { None }
|
||||
}
|
||||
}
|
||||
|
||||
fn require_valid_signature(&self) -> Result<(), 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)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,16 +1,73 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
// DO NOT EDIT
|
||||
|
||||
mod async_progress;
|
||||
pub use self::async_progress::AsyncProgress;
|
||||
pub use self::async_progress::AsyncProgressExt;
|
||||
|
||||
mod gpg_verify_result;
|
||||
pub use self::gpg_verify_result::GpgVerifyResult;
|
||||
pub use self::gpg_verify_result::GpgVerifyResultExt;
|
||||
|
||||
mod mutable_tree;
|
||||
pub use self::mutable_tree::MutableTree;
|
||||
pub use self::mutable_tree::MutableTreeExt;
|
||||
|
||||
mod repo;
|
||||
pub use self::repo::Repo;
|
||||
pub use self::repo::RepoExt;
|
||||
|
||||
mod repo_file;
|
||||
pub use self::repo_file::RepoFile;
|
||||
pub use self::repo_file::RepoFileExt;
|
||||
|
||||
mod se_policy;
|
||||
pub use self::se_policy::SePolicy;
|
||||
pub use self::se_policy::SePolicyExt;
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
mod collection_ref;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub use self::collection_ref::CollectionRef;
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
mod remote;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
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;
|
||||
|
||||
mod repo_transaction_stats;
|
||||
pub use self::repo_transaction_stats::RepoTransactionStats;
|
||||
|
||||
mod enums;
|
||||
pub use self::enums::GpgSignatureFormatFlags;
|
||||
pub use self::enums::ObjectType;
|
||||
pub use self::enums::RepoCheckoutMode;
|
||||
pub use self::enums::RepoCheckoutOverwriteMode;
|
||||
pub use self::enums::RepoMode;
|
||||
pub use self::enums::RepoPruneFlags;
|
||||
pub use self::enums::RepoRemoteChange;
|
||||
pub use self::enums::RepoResolveRevExtFlags;
|
||||
pub use self::enums::StaticDeltaGenerateOpt;
|
||||
|
||||
mod flags;
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
pub use self::flags::RepoCommitState;
|
||||
pub use self::flags::RepoPullFlags;
|
||||
pub use self::flags::SePolicyRestoreconFlags;
|
||||
|
||||
#[doc(hidden)]
|
||||
pub mod traits {
|
||||
pub use super::AsyncProgressExt;
|
||||
pub use super::GpgVerifyResultExt;
|
||||
pub use super::MutableTreeExt;
|
||||
pub use super::RepoExt;
|
||||
pub use super::RepoFileExt;
|
||||
pub use super::SePolicyExt;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,142 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Error;
|
||||
use Repo;
|
||||
use ffi;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct MutableTree(Object<ffi::OstreeMutableTree, ffi::OstreeMutableTreeClass>);
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ostree_mutable_tree_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl MutableTree {
|
||||
pub fn new() -> MutableTree {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ostree_mutable_tree_new())
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_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))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for MutableTree {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait MutableTreeExt {
|
||||
#[cfg(any(feature = "v2018_7", feature = "dox"))]
|
||||
fn check_error(&self) -> Result<(), Error>;
|
||||
|
||||
fn ensure_dir(&self, name: &str) -> Result<MutableTree, Error>;
|
||||
|
||||
//fn ensure_parent_dirs(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, metadata_checksum: &str) -> Result<MutableTree, Error>;
|
||||
|
||||
fn fill_empty_from_dirtree(&self, repo: &Repo, contents_checksum: &str, metadata_checksum: &str) -> bool;
|
||||
|
||||
fn get_contents_checksum(&self) -> Option<String>;
|
||||
|
||||
//fn get_files(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 };
|
||||
|
||||
fn get_metadata_checksum(&self) -> Option<String>;
|
||||
|
||||
//fn get_subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 37 };
|
||||
|
||||
fn replace_file(&self, name: &str, checksum: &str) -> Result<(), Error>;
|
||||
|
||||
fn set_contents_checksum(&self, checksum: &str);
|
||||
|
||||
fn set_metadata_checksum(&self, checksum: &str);
|
||||
|
||||
//fn walk(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, start: u32) -> Result<MutableTree, Error>;
|
||||
}
|
||||
|
||||
impl<O: IsA<MutableTree>> MutableTreeExt for O {
|
||||
#[cfg(any(feature = "v2018_7", feature = "dox"))]
|
||||
fn check_error(&self) -> Result<(), 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)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn ensure_dir(&self, name: &str) -> Result<MutableTree, 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)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn ensure_parent_dirs(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, metadata_checksum: &str) -> Result<MutableTree, Error> {
|
||||
// unsafe { TODO: call ffi::ostree_mutable_tree_ensure_parent_dirs() }
|
||||
//}
|
||||
|
||||
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))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_contents_checksum(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ostree_mutable_tree_get_contents_checksum(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
//fn get_files(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 } {
|
||||
// unsafe { TODO: call ffi::ostree_mutable_tree_get_files() }
|
||||
//}
|
||||
|
||||
fn get_metadata_checksum(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ostree_mutable_tree_get_metadata_checksum(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
//fn get_subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 37 } {
|
||||
// unsafe { TODO: call ffi::ostree_mutable_tree_get_subdirs() }
|
||||
//}
|
||||
|
||||
fn replace_file(&self, name: &str, checksum: &str) -> Result<(), 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)) }
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
//fn walk(&self, split_path: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, start: u32) -> Result<MutableTree, Error> {
|
||||
// unsafe { TODO: call ffi::ostree_mutable_tree_walk() }
|
||||
//}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
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),
|
||||
get_type => || ffi::ostree_remote_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl Remote {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub fn get_name(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ostree_remote_get_name(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub fn get_url(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ostree_remote_get_url(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +1,45 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use AsyncProgress;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use CollectionRef;
|
||||
use Error;
|
||||
use GpgVerifyResult;
|
||||
use MutableTree;
|
||||
use ObjectType;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use Remote;
|
||||
use RepoCheckoutMode;
|
||||
use RepoCheckoutOverwriteMode;
|
||||
use RepoCommitModifier;
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
use RepoCommitState;
|
||||
use RepoFile;
|
||||
use RepoMode;
|
||||
use RepoPruneFlags;
|
||||
use RepoPullFlags;
|
||||
use RepoRemoteChange;
|
||||
use RepoResolveRevExtFlags;
|
||||
use RepoTransactionStats;
|
||||
use StaticDeltaGenerateOpt;
|
||||
use ffi;
|
||||
use gio;
|
||||
use glib;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::Downcast;
|
||||
use glib::object::IsA;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use libc;
|
||||
use std::boxed::Box as Box_;
|
||||
use std::mem;
|
||||
use std::mem::transmute;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
|
|
@ -64,7 +89,7 @@ impl Repo {
|
|||
}
|
||||
}
|
||||
|
||||
//pub fn pull_default_console_progress_changed<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(progress: /*Ignored*/&AsyncProgress, user_data: P) {
|
||||
//pub fn pull_default_console_progress_changed<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(progress: &AsyncProgress, user_data: P) {
|
||||
// unsafe { TODO: call ffi::ostree_repo_pull_default_console_progress_changed() }
|
||||
//}
|
||||
|
||||
|
|
@ -88,19 +113,19 @@ pub trait RepoExt {
|
|||
|
||||
fn add_gpg_signature_summary<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, key_id: &[&str], homedir: P, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
//fn append_gpg_signature<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, signature_bytes: /*Ignored*/&glib::Bytes, cancellable: P) -> Result<(), Error>;
|
||||
fn append_gpg_signature<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, signature_bytes: &glib::Bytes, cancellable: P) -> Result<(), Error>;
|
||||
|
||||
//fn checkout_at<'a, 'b, P: Into<Option<&'a /*Ignored*/RepoCheckoutAtOptions>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, options: P, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
fn checkout_gc<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error>;
|
||||
|
||||
//fn checkout_tree<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(&self, mode: /*Ignored*/RepoCheckoutMode, overwrite_mode: /*Ignored*/RepoCheckoutOverwriteMode, destination: &P, source: /*Ignored*/&RepoFile, source_info: /*Ignored*/&gio::FileInfo, cancellable: Q) -> Result<(), Error>;
|
||||
fn checkout_tree<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(&self, mode: RepoCheckoutMode, overwrite_mode: RepoCheckoutOverwriteMode, destination: &P, source: &RepoFile, source_info: &gio::FileInfo, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
//fn checkout_tree_at<'a, 'b, P: Into<Option<&'a /*Ignored*/RepoCheckoutOptions>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, options: P, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
//fn commit_transaction<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, out_stats: /*Ignored*/RepoTransactionStats, cancellable: P) -> Result<(), Error>;
|
||||
fn commit_transaction<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<RepoTransactionStats, Error>;
|
||||
|
||||
//fn copy_config(&self) -> /*Ignored*/Option<glib::KeyFile>;
|
||||
fn copy_config(&self) -> Option<glib::KeyFile>;
|
||||
|
||||
fn create<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, mode: RepoMode, cancellable: P) -> Result<(), Error>;
|
||||
|
||||
|
|
@ -109,7 +134,7 @@ pub trait RepoExt {
|
|||
#[cfg(any(feature = "v2017_12", feature = "dox"))]
|
||||
fn equal(&self, b: &Repo) -> bool;
|
||||
|
||||
//fn export_tree_to_archive<'a, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a gio::Cancellable>>>(&self, opts: /*Ignored*/&mut RepoExportArchiveOptions, root: /*Ignored*/&RepoFile, archive: P, cancellable: Q) -> Result<(), Error>;
|
||||
//fn export_tree_to_archive<'a, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a gio::Cancellable>>>(&self, opts: /*Ignored*/&mut RepoExportArchiveOptions, root: &RepoFile, archive: P, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
#[cfg(any(feature = "v2017_15", feature = "dox"))]
|
||||
fn fsck_object<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, sha256: &str, cancellable: P) -> Result<(), Error>;
|
||||
|
|
@ -117,7 +142,7 @@ pub trait RepoExt {
|
|||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn get_collection_id(&self) -> Option<String>;
|
||||
|
||||
//fn get_config(&self) -> /*Ignored*/Option<glib::KeyFile>;
|
||||
fn get_config(&self) -> Option<glib::KeyFile>;
|
||||
|
||||
fn get_dfd(&self) -> i32;
|
||||
|
||||
|
|
@ -135,14 +160,14 @@ pub trait RepoExt {
|
|||
|
||||
fn get_remote_option<'a, P: Into<Option<&'a str>>>(&self, remote_name: &str, option_name: &str, default_value: P) -> Result<String, Error>;
|
||||
|
||||
//fn gpg_verify_data<'a, 'b, 'c, 'd, P: Into<Option<&'a str>>, Q: IsA<gio::File> + 'b, R: Into<Option<&'b Q>>, S: IsA<gio::File> + 'c, T: Into<Option<&'c S>>, U: Into<Option<&'d gio::Cancellable>>>(&self, remote_name: P, data: /*Ignored*/&glib::Bytes, signatures: /*Ignored*/&glib::Bytes, keyringdir: R, extra_keyring: T, cancellable: U) -> Result</*Ignored*/GpgVerifyResult, Error>;
|
||||
fn gpg_verify_data<'a, 'b, 'c, 'd, P: Into<Option<&'a str>>, Q: IsA<gio::File> + 'b, R: Into<Option<&'b Q>>, S: IsA<gio::File> + 'c, T: Into<Option<&'c S>>, U: Into<Option<&'d gio::Cancellable>>>(&self, remote_name: P, data: &glib::Bytes, signatures: &glib::Bytes, keyringdir: R, extra_keyring: T, cancellable: U) -> Result<GpgVerifyResult, Error>;
|
||||
|
||||
fn has_object<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<bool, Error>;
|
||||
|
||||
#[cfg(any(feature = "v2017_12", feature = "dox"))]
|
||||
fn hash(&self) -> u32;
|
||||
|
||||
//fn import_archive_to_mtree<'a, 'b, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a /*Ignored*/RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, opts: /*Ignored*/&mut RepoImportArchiveOptions, archive: P, mtree: /*Ignored*/&MutableTree, modifier: Q, cancellable: R) -> Result<(), Error>;
|
||||
//fn import_archive_to_mtree<'a, 'b, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, opts: /*Ignored*/&mut RepoImportArchiveOptions, archive: P, mtree: &MutableTree, modifier: Q, cancellable: R) -> Result<(), Error>;
|
||||
|
||||
fn import_object_from<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, source: &Repo, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<(), Error>;
|
||||
|
||||
|
|
@ -165,12 +190,12 @@ pub trait RepoExt {
|
|||
|
||||
//fn list_static_delta_names<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, out_deltas: /*Unknown conversion*//*Unimplemented*/PtrArray TypeId { ns_id: 0, id: 28 }, cancellable: P) -> Result<(), Error>;
|
||||
|
||||
//#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
//fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, /*Ignored*/RepoCommitState), Error>;
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, RepoCommitState), Error>;
|
||||
|
||||
//fn load_file<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, checksum: &str, out_input: /*Ignored*/Option<gio::InputStream>, out_file_info: /*Ignored*/Option<gio::FileInfo>, cancellable: P) -> Result<Option<glib::Variant>, Error>;
|
||||
fn load_file<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, checksum: &str, cancellable: P) -> Result<(Option<gio::InputStream>, Option<gio::FileInfo>, Option<glib::Variant>), Error>;
|
||||
|
||||
//fn load_object_stream<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, out_input: /*Ignored*/gio::InputStream, cancellable: P) -> Result<u64, Error>;
|
||||
fn load_object_stream<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<(gio::InputStream, u64), Error>;
|
||||
|
||||
fn load_variant(&self, objtype: ObjectType, sha256: &str) -> Result<glib::Variant, Error>;
|
||||
|
||||
|
|
@ -183,17 +208,17 @@ pub trait RepoExt {
|
|||
|
||||
fn prepare_transaction<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<bool, Error>;
|
||||
|
||||
//fn prune<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, flags: /*Ignored*/RepoPruneFlags, depth: i32, cancellable: P) -> Result<(i32, i32, u64), Error>;
|
||||
fn prune<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, flags: RepoPruneFlags, depth: i32, cancellable: P) -> Result<(i32, i32, u64), Error>;
|
||||
|
||||
//fn prune_from_reachable<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: P) -> Result<(i32, i32, u64), Error>;
|
||||
|
||||
fn prune_static_deltas<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, commit: P, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
//fn pull<'a, 'b, P: Into<Option<&'a /*Ignored*/AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name: &str, refs_to_fetch: &[&str], flags: /*Ignored*/RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error>;
|
||||
fn pull<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
//fn pull_one_dir<'a, 'b, P: Into<Option<&'a /*Ignored*/AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: /*Ignored*/RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error>;
|
||||
fn pull_one_dir<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
//fn pull_with_options<'a, 'b, P: Into<Option<&'a /*Ignored*/AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name_or_baseurl: &str, options: &glib::Variant, progress: P, cancellable: Q) -> Result<(), Error>;
|
||||
fn pull_with_options<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name_or_baseurl: &str, options: &glib::Variant, progress: P, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
fn query_object_storage_size<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, sha256: &str, cancellable: P) -> Result<u64, Error>;
|
||||
|
||||
|
|
@ -207,13 +232,13 @@ pub trait RepoExt {
|
|||
|
||||
fn remote_add<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, name: &str, url: &str, options: P, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
//fn remote_change<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: Into<Option<&'b glib::Variant>>, S: Into<Option<&'c gio::Cancellable>>>(&self, sysroot: Q, changeop: /*Ignored*/RepoRemoteChange, name: &str, url: &str, options: R, cancellable: S) -> Result<(), Error>;
|
||||
fn remote_change<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: Into<Option<&'b glib::Variant>>, S: Into<Option<&'c gio::Cancellable>>>(&self, sysroot: Q, changeop: RepoRemoteChange, name: &str, url: &str, options: R, cancellable: S) -> Result<(), Error>;
|
||||
|
||||
fn remote_delete<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, name: &str, cancellable: P) -> Result<(), Error>;
|
||||
|
||||
//fn remote_fetch_summary<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, name: &str, out_summary: /*Ignored*/glib::Bytes, out_signatures: /*Ignored*/glib::Bytes, cancellable: P) -> Result<(), Error>;
|
||||
fn remote_fetch_summary<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, name: &str, cancellable: P) -> Result<(glib::Bytes, glib::Bytes), Error>;
|
||||
|
||||
//fn remote_fetch_summary_with_options<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, name: &str, options: P, out_summary: /*Ignored*/glib::Bytes, out_signatures: /*Ignored*/glib::Bytes, cancellable: Q) -> Result<(), Error>;
|
||||
fn remote_fetch_summary_with_options<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, name: &str, options: P, cancellable: Q) -> Result<(glib::Bytes, glib::Bytes), Error>;
|
||||
|
||||
fn remote_get_gpg_verify(&self, name: &str) -> Result<bool, Error>;
|
||||
|
||||
|
|
@ -221,8 +246,6 @@ pub trait RepoExt {
|
|||
|
||||
fn remote_get_url(&self, name: &str) -> Result<String, Error>;
|
||||
|
||||
//fn remote_gpg_import<'a, 'b, P: IsA</*Ignored*/gio::InputStream> + 'a, Q: Into<Option<&'a P>>, R: Into<Option<u32>>, S: Into<Option<&'b gio::Cancellable>>>(&self, name: &str, source_stream: Q, key_ids: &[&str], out_imported: R, cancellable: S) -> Result<(), Error>;
|
||||
|
||||
fn remote_list(&self) -> Vec<String>;
|
||||
|
||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
|
|
@ -230,15 +253,15 @@ pub trait RepoExt {
|
|||
|
||||
//fn remote_list_refs<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, remote_name: &str, out_all_refs: /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 0, id: 28 }, cancellable: P) -> Result<(), Error>;
|
||||
|
||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
//fn resolve_collection_ref<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, ref_: /*Ignored*/&CollectionRef, allow_noent: bool, flags: /*Ignored*/RepoResolveRevExtFlags, cancellable: P) -> Result<Option<String>, Error>;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn resolve_collection_ref<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, ref_: &CollectionRef, allow_noent: bool, flags: RepoResolveRevExtFlags, cancellable: P) -> Result<Option<String>, Error>;
|
||||
|
||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
//fn resolve_keyring_for_collection<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, collection_id: &str, cancellable: P) -> Result</*Ignored*/Remote, Error>;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn resolve_keyring_for_collection<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, collection_id: &str, cancellable: P) -> Result<Remote, Error>;
|
||||
|
||||
fn resolve_rev(&self, refspec: &str, allow_noent: bool) -> Result<String, Error>;
|
||||
|
||||
//fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: /*Ignored*/RepoResolveRevExtFlags) -> Result<String, Error>;
|
||||
fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: RepoResolveRevExtFlags) -> Result<String, Error>;
|
||||
|
||||
fn scan_hardlinks<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error>;
|
||||
|
||||
|
|
@ -249,8 +272,8 @@ pub trait RepoExt {
|
|||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn set_collection_id<'a, P: Into<Option<&'a str>>>(&self, collection_id: P) -> Result<(), Error>;
|
||||
|
||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
//fn set_collection_ref_immediate<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, ref_: /*Ignored*/&CollectionRef, checksum: P, cancellable: Q) -> Result<(), Error>;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn set_collection_ref_immediate<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, ref_: &CollectionRef, checksum: P, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
fn set_disable_fsync(&self, disable_fsync: bool);
|
||||
|
||||
|
|
@ -262,10 +285,10 @@ pub trait RepoExt {
|
|||
|
||||
fn static_delta_execute_offline<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(&self, dir_or_file: &P, skip_validation: bool, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
//fn static_delta_generate<'a, 'b, 'c, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b glib::Variant>>, R: Into<Option<&'c gio::Cancellable>>>(&self, opt: /*Ignored*/StaticDeltaGenerateOpt, from: &str, to: &str, metadata: P, params: Q, cancellable: R) -> Result<(), Error>;
|
||||
fn static_delta_generate<'a, 'b, 'c, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b glib::Variant>>, R: Into<Option<&'c gio::Cancellable>>>(&self, opt: StaticDeltaGenerateOpt, from: &str, to: &str, metadata: P, params: Q, cancellable: R) -> Result<(), Error>;
|
||||
|
||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
//fn transaction_set_collection_ref<'a, P: Into<Option<&'a str>>>(&self, ref_: /*Ignored*/&CollectionRef, checksum: P);
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn transaction_set_collection_ref<'a, P: Into<Option<&'a str>>>(&self, ref_: &CollectionRef, checksum: P);
|
||||
|
||||
fn transaction_set_ref<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>>(&self, remote: P, ref_: &str, checksum: Q);
|
||||
|
||||
|
|
@ -283,43 +306,43 @@ pub trait RepoExt {
|
|||
|
||||
fn verify_commit<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: IsA<gio::File> + 'b, S: Into<Option<&'b R>>, T: Into<Option<&'c gio::Cancellable>>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result<(), Error>;
|
||||
|
||||
//fn verify_commit_ext<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: IsA<gio::File> + 'b, S: Into<Option<&'b R>>, T: Into<Option<&'c gio::Cancellable>>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result</*Ignored*/GpgVerifyResult, Error>;
|
||||
fn verify_commit_ext<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: IsA<gio::File> + 'b, S: Into<Option<&'b R>>, T: Into<Option<&'c gio::Cancellable>>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result<GpgVerifyResult, Error>;
|
||||
|
||||
//fn verify_commit_for_remote<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, remote_name: &str, cancellable: P) -> Result</*Ignored*/GpgVerifyResult, Error>;
|
||||
fn verify_commit_for_remote<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, remote_name: &str, cancellable: P) -> Result<GpgVerifyResult, Error>;
|
||||
|
||||
//fn verify_summary<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, remote_name: &str, summary: /*Ignored*/&glib::Bytes, signatures: /*Ignored*/&glib::Bytes, cancellable: P) -> Result</*Ignored*/GpgVerifyResult, Error>;
|
||||
fn verify_summary<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, remote_name: &str, summary: &glib::Bytes, signatures: &glib::Bytes, cancellable: P) -> Result<GpgVerifyResult, Error>;
|
||||
|
||||
//fn write_archive_to_mtree<'a, 'b, P: IsA<gio::File>, Q: Into<Option<&'a /*Ignored*/RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, archive: &P, mtree: /*Ignored*/&MutableTree, modifier: Q, autocreate_parents: bool, cancellable: R) -> Result<(), Error>;
|
||||
fn write_archive_to_mtree<'a, 'b, P: IsA<gio::File>, Q: Into<Option<&'a RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, archive: &P, mtree: &MutableTree, modifier: Q, autocreate_parents: bool, cancellable: R) -> Result<(), Error>;
|
||||
|
||||
//fn write_commit<'a, 'b, 'c, 'd, 'e, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c str>>, S: Into<Option<&'d glib::Variant>>, T: Into<Option<&'e gio::Cancellable>>>(&self, parent: P, subject: Q, body: R, metadata: S, root: /*Ignored*/&RepoFile, cancellable: T) -> Result<String, Error>;
|
||||
fn write_commit<'a, 'b, 'c, 'd, 'e, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c str>>, S: Into<Option<&'d glib::Variant>>, T: Into<Option<&'e gio::Cancellable>>>(&self, parent: P, subject: Q, body: R, metadata: S, root: &RepoFile, cancellable: T) -> Result<String, Error>;
|
||||
|
||||
fn write_commit_detached_metadata<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, checksum: &str, metadata: P, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
//fn write_commit_with_time<'a, 'b, 'c, 'd, 'e, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c str>>, S: Into<Option<&'d glib::Variant>>, T: Into<Option<&'e gio::Cancellable>>>(&self, parent: P, subject: Q, body: R, metadata: S, root: /*Ignored*/&RepoFile, time: u64, cancellable: T) -> Result<String, Error>;
|
||||
fn write_commit_with_time<'a, 'b, 'c, 'd, 'e, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c str>>, S: Into<Option<&'d glib::Variant>>, T: Into<Option<&'e gio::Cancellable>>>(&self, parent: P, subject: Q, body: R, metadata: S, root: &RepoFile, time: u64, cancellable: T) -> Result<String, Error>;
|
||||
|
||||
//fn write_config(&self, new_config: /*Ignored*/&glib::KeyFile) -> Result<(), Error>;
|
||||
fn write_config(&self, new_config: &glib::KeyFile) -> Result<(), Error>;
|
||||
|
||||
//fn write_content<'a, 'b, P: Into<Option<&'a str>>, Q: IsA</*Ignored*/gio::InputStream>, R: Into<Option<&'b gio::Cancellable>>>(&self, expected_checksum: P, object_input: &Q, length: u64, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: R) -> Result<(), Error>;
|
||||
//fn write_content<'a, 'b, P: Into<Option<&'a str>>, Q: IsA<gio::InputStream>, R: Into<Option<&'b gio::Cancellable>>>(&self, expected_checksum: P, object_input: &Q, length: u64, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: R) -> Result<(), Error>;
|
||||
|
||||
//fn write_content_trusted<'a, P: IsA</*Ignored*/gio::InputStream>, Q: Into<Option<&'a gio::Cancellable>>>(&self, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error>;
|
||||
fn write_content_trusted<'a, P: IsA<gio::InputStream>, Q: Into<Option<&'a gio::Cancellable>>>(&self, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
//fn write_dfd_to_mtree<'a, 'b, P: Into<Option<&'a /*Ignored*/RepoCommitModifier>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, dfd: i32, path: &str, mtree: /*Ignored*/&MutableTree, modifier: P, cancellable: Q) -> Result<(), Error>;
|
||||
fn write_dfd_to_mtree<'a, 'b, P: Into<Option<&'a RepoCommitModifier>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, dfd: i32, path: &str, mtree: &MutableTree, modifier: P, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
//fn write_directory_to_mtree<'a, 'b, P: IsA<gio::File>, Q: Into<Option<&'a /*Ignored*/RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, dir: &P, mtree: /*Ignored*/&MutableTree, modifier: Q, cancellable: R) -> Result<(), Error>;
|
||||
fn write_directory_to_mtree<'a, 'b, P: IsA<gio::File>, Q: Into<Option<&'a RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, dir: &P, mtree: &MutableTree, modifier: Q, cancellable: R) -> Result<(), Error>;
|
||||
|
||||
//fn write_metadata<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, objtype: ObjectType, expected_checksum: P, object: &glib::Variant, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
//fn write_metadata_stream_trusted<'a, P: IsA</*Ignored*/gio::InputStream>, Q: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error>;
|
||||
fn write_metadata_stream_trusted<'a, P: IsA<gio::InputStream>, Q: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error>;
|
||||
|
||||
fn write_metadata_trusted<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, variant: &glib::Variant, cancellable: P) -> Result<(), Error>;
|
||||
|
||||
//fn write_mtree<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, mtree: /*Ignored*/&MutableTree, cancellable: P) -> Result<gio::File, Error>;
|
||||
fn write_mtree<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, mtree: &MutableTree, cancellable: P) -> Result<gio::File, Error>;
|
||||
|
||||
fn get_property_remotes_config_dir(&self) -> Option<String>;
|
||||
|
||||
fn get_property_sysroot_path(&self) -> Option<gio::File>;
|
||||
|
||||
//fn connect_gpg_verify_result<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId;
|
||||
fn connect_gpg_verify_result<F: Fn(&Self, &str, &GpgVerifyResult) + 'static>(&self, f: F) -> SignalHandlerId;
|
||||
}
|
||||
|
||||
impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
||||
|
|
@ -345,9 +368,15 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn append_gpg_signature<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, signature_bytes: /*Ignored*/&glib::Bytes, cancellable: P) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_append_gpg_signature() }
|
||||
//}
|
||||
fn append_gpg_signature<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, signature_bytes: &glib::Bytes, cancellable: P) -> Result<(), Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_append_gpg_signature(self.to_glib_none().0, commit_checksum.to_glib_none().0, signature_bytes.to_glib_none().0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn checkout_at<'a, 'b, P: Into<Option<&'a /*Ignored*/RepoCheckoutAtOptions>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, options: P, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Q) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_checkout_at() }
|
||||
|
|
@ -363,21 +392,36 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn checkout_tree<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(&self, mode: /*Ignored*/RepoCheckoutMode, overwrite_mode: /*Ignored*/RepoCheckoutOverwriteMode, destination: &P, source: /*Ignored*/&RepoFile, source_info: /*Ignored*/&gio::FileInfo, cancellable: Q) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_checkout_tree() }
|
||||
//}
|
||||
fn checkout_tree<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(&self, mode: RepoCheckoutMode, overwrite_mode: RepoCheckoutOverwriteMode, destination: &P, source: &RepoFile, source_info: &gio::FileInfo, cancellable: Q) -> Result<(), Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_checkout_tree(self.to_glib_none().0, mode.to_glib(), overwrite_mode.to_glib(), destination.to_glib_none().0, source.to_glib_none().0, source_info.to_glib_none().0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn checkout_tree_at<'a, 'b, P: Into<Option<&'a /*Ignored*/RepoCheckoutOptions>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, options: P, destination_dfd: i32, destination_path: &str, commit: &str, cancellable: Q) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_checkout_tree_at() }
|
||||
//}
|
||||
|
||||
//fn commit_transaction<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, out_stats: /*Ignored*/RepoTransactionStats, cancellable: P) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_commit_transaction() }
|
||||
//}
|
||||
fn commit_transaction<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<RepoTransactionStats, Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut out_stats = RepoTransactionStats::uninitialized();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_commit_transaction(self.to_glib_none().0, out_stats.to_glib_none_mut().0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(out_stats) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn copy_config(&self) -> /*Ignored*/Option<glib::KeyFile> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_copy_config() }
|
||||
//}
|
||||
fn copy_config(&self) -> Option<glib::KeyFile> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ostree_repo_copy_config(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn create<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, mode: RepoMode, cancellable: P) -> Result<(), Error> {
|
||||
let cancellable = cancellable.into();
|
||||
|
|
@ -406,7 +450,7 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn export_tree_to_archive<'a, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a gio::Cancellable>>>(&self, opts: /*Ignored*/&mut RepoExportArchiveOptions, root: /*Ignored*/&RepoFile, archive: P, cancellable: Q) -> Result<(), Error> {
|
||||
//fn export_tree_to_archive<'a, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a gio::Cancellable>>>(&self, opts: /*Ignored*/&mut RepoExportArchiveOptions, root: &RepoFile, archive: P, cancellable: Q) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_export_tree_to_archive() }
|
||||
//}
|
||||
|
||||
|
|
@ -428,9 +472,11 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn get_config(&self) -> /*Ignored*/Option<glib::KeyFile> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_get_config() }
|
||||
//}
|
||||
fn get_config(&self) -> Option<glib::KeyFile> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ostree_repo_get_config(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_dfd(&self) -> i32 {
|
||||
unsafe {
|
||||
|
|
@ -491,9 +537,21 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn gpg_verify_data<'a, 'b, 'c, 'd, P: Into<Option<&'a str>>, Q: IsA<gio::File> + 'b, R: Into<Option<&'b Q>>, S: IsA<gio::File> + 'c, T: Into<Option<&'c S>>, U: Into<Option<&'d gio::Cancellable>>>(&self, remote_name: P, data: /*Ignored*/&glib::Bytes, signatures: /*Ignored*/&glib::Bytes, keyringdir: R, extra_keyring: T, cancellable: U) -> Result</*Ignored*/GpgVerifyResult, Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_gpg_verify_data() }
|
||||
//}
|
||||
fn gpg_verify_data<'a, 'b, 'c, 'd, P: Into<Option<&'a str>>, Q: IsA<gio::File> + 'b, R: Into<Option<&'b Q>>, S: IsA<gio::File> + 'c, T: Into<Option<&'c S>>, U: Into<Option<&'d gio::Cancellable>>>(&self, remote_name: P, data: &glib::Bytes, signatures: &glib::Bytes, keyringdir: R, extra_keyring: T, cancellable: U) -> Result<GpgVerifyResult, Error> {
|
||||
let remote_name = remote_name.into();
|
||||
let remote_name = remote_name.to_glib_none();
|
||||
let keyringdir = keyringdir.into();
|
||||
let keyringdir = keyringdir.to_glib_none();
|
||||
let extra_keyring = extra_keyring.into();
|
||||
let extra_keyring = extra_keyring.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ffi::ostree_repo_gpg_verify_data(self.to_glib_none().0, remote_name.0, data.to_glib_none().0, signatures.to_glib_none().0, keyringdir.0, extra_keyring.0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn has_object<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<bool, Error> {
|
||||
let cancellable = cancellable.into();
|
||||
|
|
@ -513,7 +571,7 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn import_archive_to_mtree<'a, 'b, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a /*Ignored*/RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, opts: /*Ignored*/&mut RepoImportArchiveOptions, archive: P, mtree: /*Ignored*/&MutableTree, modifier: Q, cancellable: R) -> Result<(), Error> {
|
||||
//fn import_archive_to_mtree<'a, 'b, P: Into<Option</*Unimplemented*/Fundamental: Pointer>>, Q: Into<Option<&'a RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, opts: /*Ignored*/&mut RepoImportArchiveOptions, archive: P, mtree: &MutableTree, modifier: Q, cancellable: R) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_import_archive_to_mtree() }
|
||||
//}
|
||||
|
||||
|
|
@ -576,18 +634,41 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
// unsafe { TODO: call ffi::ostree_repo_list_static_delta_names() }
|
||||
//}
|
||||
|
||||
//#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
//fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, /*Ignored*/RepoCommitState), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_load_commit() }
|
||||
//}
|
||||
#[cfg(any(feature = "v2015_7", feature = "dox"))]
|
||||
fn load_commit(&self, checksum: &str) -> Result<(glib::Variant, RepoCommitState), Error> {
|
||||
unsafe {
|
||||
let mut out_commit = ptr::null_mut();
|
||||
let mut out_state = mem::uninitialized();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_load_commit(self.to_glib_none().0, checksum.to_glib_none().0, &mut out_commit, &mut out_state, &mut error);
|
||||
if error.is_null() { Ok((from_glib_full(out_commit), from_glib(out_state))) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn load_file<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, checksum: &str, out_input: /*Ignored*/Option<gio::InputStream>, out_file_info: /*Ignored*/Option<gio::FileInfo>, cancellable: P) -> Result<Option<glib::Variant>, Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_load_file() }
|
||||
//}
|
||||
fn load_file<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, checksum: &str, cancellable: P) -> Result<(Option<gio::InputStream>, Option<gio::FileInfo>, Option<glib::Variant>), Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
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_repo_load_file(self.to_glib_none().0, checksum.to_glib_none().0, &mut out_input, &mut out_file_info, &mut out_xattrs, cancellable.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)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn load_object_stream<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, out_input: /*Ignored*/gio::InputStream, cancellable: P) -> Result<u64, Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_load_object_stream() }
|
||||
//}
|
||||
fn load_object_stream<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, cancellable: P) -> Result<(gio::InputStream, u64), Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut out_input = ptr::null_mut();
|
||||
let mut out_size = mem::uninitialized();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_load_object_stream(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, &mut out_input, &mut out_size, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok((from_glib_full(out_input), out_size)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn load_variant(&self, objtype: ObjectType, sha256: &str) -> Result<glib::Variant, Error> {
|
||||
unsafe {
|
||||
|
|
@ -637,9 +718,18 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn prune<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, flags: /*Ignored*/RepoPruneFlags, depth: i32, cancellable: P) -> Result<(i32, i32, u64), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_prune() }
|
||||
//}
|
||||
fn prune<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, flags: RepoPruneFlags, depth: i32, cancellable: P) -> Result<(i32, i32, u64), Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut out_objects_total = mem::uninitialized();
|
||||
let mut out_objects_pruned = mem::uninitialized();
|
||||
let mut out_pruned_object_size_total = mem::uninitialized();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_prune(self.to_glib_none().0, flags.to_glib(), depth, &mut out_objects_total, &mut out_objects_pruned, &mut out_pruned_object_size_total, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok((out_objects_total, out_objects_pruned, out_pruned_object_size_total)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn prune_from_reachable<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, options: /*Ignored*/&mut RepoPruneOptions, cancellable: P) -> Result<(i32, i32, u64), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_prune_from_reachable() }
|
||||
|
|
@ -657,17 +747,41 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn pull<'a, 'b, P: Into<Option<&'a /*Ignored*/AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name: &str, refs_to_fetch: &[&str], flags: /*Ignored*/RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_pull() }
|
||||
//}
|
||||
fn pull<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error> {
|
||||
let progress = progress.into();
|
||||
let progress = progress.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_pull(self.to_glib_none().0, remote_name.to_glib_none().0, refs_to_fetch.to_glib_none().0, flags.to_glib(), progress.0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn pull_one_dir<'a, 'b, P: Into<Option<&'a /*Ignored*/AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: /*Ignored*/RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_pull_one_dir() }
|
||||
//}
|
||||
fn pull_one_dir<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name: &str, dir_to_pull: &str, refs_to_fetch: &[&str], flags: RepoPullFlags, progress: P, cancellable: Q) -> Result<(), Error> {
|
||||
let progress = progress.into();
|
||||
let progress = progress.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_pull_one_dir(self.to_glib_none().0, remote_name.to_glib_none().0, dir_to_pull.to_glib_none().0, refs_to_fetch.to_glib_none().0, flags.to_glib(), progress.0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn pull_with_options<'a, 'b, P: Into<Option<&'a /*Ignored*/AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name_or_baseurl: &str, options: &glib::Variant, progress: P, cancellable: Q) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_pull_with_options() }
|
||||
//}
|
||||
fn pull_with_options<'a, 'b, P: Into<Option<&'a AsyncProgress>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, remote_name_or_baseurl: &str, options: &glib::Variant, progress: P, cancellable: Q) -> Result<(), Error> {
|
||||
let progress = progress.into();
|
||||
let progress = progress.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_pull_with_options(self.to_glib_none().0, remote_name_or_baseurl.to_glib_none().0, options.to_glib_none().0, progress.0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn query_object_storage_size<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, sha256: &str, cancellable: P) -> Result<u64, Error> {
|
||||
let cancellable = cancellable.into();
|
||||
|
|
@ -737,9 +851,19 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn remote_change<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: Into<Option<&'b glib::Variant>>, S: Into<Option<&'c gio::Cancellable>>>(&self, sysroot: Q, changeop: /*Ignored*/RepoRemoteChange, name: &str, url: &str, options: R, cancellable: S) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_remote_change() }
|
||||
//}
|
||||
fn remote_change<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: Into<Option<&'b glib::Variant>>, S: Into<Option<&'c gio::Cancellable>>>(&self, sysroot: Q, changeop: RepoRemoteChange, name: &str, url: &str, options: R, cancellable: S) -> Result<(), Error> {
|
||||
let sysroot = sysroot.into();
|
||||
let sysroot = sysroot.to_glib_none();
|
||||
let options = options.into();
|
||||
let options = options.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_remote_change(self.to_glib_none().0, sysroot.0, changeop.to_glib(), name.to_glib_none().0, url.to_glib_none().0, options.0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn remote_delete<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, name: &str, cancellable: P) -> Result<(), Error> {
|
||||
let cancellable = cancellable.into();
|
||||
|
|
@ -751,13 +875,31 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn remote_fetch_summary<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, name: &str, out_summary: /*Ignored*/glib::Bytes, out_signatures: /*Ignored*/glib::Bytes, cancellable: P) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_remote_fetch_summary() }
|
||||
//}
|
||||
fn remote_fetch_summary<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, name: &str, cancellable: P) -> Result<(glib::Bytes, glib::Bytes), Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut out_summary = ptr::null_mut();
|
||||
let mut out_signatures = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_remote_fetch_summary(self.to_glib_none().0, name.to_glib_none().0, &mut out_summary, &mut out_signatures, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok((from_glib_full(out_summary), from_glib_full(out_signatures))) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn remote_fetch_summary_with_options<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, name: &str, options: P, out_summary: /*Ignored*/glib::Bytes, out_signatures: /*Ignored*/glib::Bytes, cancellable: Q) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_remote_fetch_summary_with_options() }
|
||||
//}
|
||||
fn remote_fetch_summary_with_options<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, name: &str, options: P, cancellable: Q) -> Result<(glib::Bytes, glib::Bytes), Error> {
|
||||
let options = options.into();
|
||||
let options = options.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut out_summary = ptr::null_mut();
|
||||
let mut out_signatures = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_remote_fetch_summary_with_options(self.to_glib_none().0, name.to_glib_none().0, options.0, &mut out_summary, &mut out_signatures, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok((from_glib_full(out_summary), from_glib_full(out_signatures))) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn remote_get_gpg_verify(&self, name: &str) -> Result<bool, Error> {
|
||||
unsafe {
|
||||
|
|
@ -786,10 +928,6 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn remote_gpg_import<'a, 'b, P: IsA</*Ignored*/gio::InputStream> + 'a, Q: Into<Option<&'a P>>, R: Into<Option<u32>>, S: Into<Option<&'b gio::Cancellable>>>(&self, name: &str, source_stream: Q, key_ids: &[&str], out_imported: R, cancellable: S) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_remote_gpg_import() }
|
||||
//}
|
||||
|
||||
fn remote_list(&self) -> Vec<String> {
|
||||
unsafe {
|
||||
let mut out_n_remotes = mem::uninitialized();
|
||||
|
|
@ -807,15 +945,28 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
// unsafe { TODO: call ffi::ostree_repo_remote_list_refs() }
|
||||
//}
|
||||
|
||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
//fn resolve_collection_ref<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, ref_: /*Ignored*/&CollectionRef, allow_noent: bool, flags: /*Ignored*/RepoResolveRevExtFlags, cancellable: P) -> Result<Option<String>, Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_resolve_collection_ref() }
|
||||
//}
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn resolve_collection_ref<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, ref_: &CollectionRef, allow_noent: bool, flags: RepoResolveRevExtFlags, cancellable: P) -> Result<Option<String>, Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut out_rev = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_resolve_collection_ref(self.to_glib_none().0, ref_.to_glib_none().0, allow_noent.to_glib(), flags.to_glib(), &mut out_rev, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(out_rev)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
//fn resolve_keyring_for_collection<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, collection_id: &str, cancellable: P) -> Result</*Ignored*/Remote, Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_resolve_keyring_for_collection() }
|
||||
//}
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn resolve_keyring_for_collection<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, collection_id: &str, cancellable: P) -> Result<Remote, Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ffi::ostree_repo_resolve_keyring_for_collection(self.to_glib_none().0, collection_id.to_glib_none().0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn resolve_rev(&self, refspec: &str, allow_noent: bool) -> Result<String, Error> {
|
||||
unsafe {
|
||||
|
|
@ -826,9 +977,14 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: /*Ignored*/RepoResolveRevExtFlags) -> Result<String, Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_resolve_rev_ext() }
|
||||
//}
|
||||
fn resolve_rev_ext(&self, refspec: &str, allow_noent: bool, flags: RepoResolveRevExtFlags) -> Result<String, Error> {
|
||||
unsafe {
|
||||
let mut out_rev = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_resolve_rev_ext(self.to_glib_none().0, refspec.to_glib_none().0, allow_noent.to_glib(), flags.to_glib(), &mut out_rev, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(out_rev)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn scan_hardlinks<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, cancellable: P) -> Result<(), Error> {
|
||||
let cancellable = cancellable.into();
|
||||
|
|
@ -875,10 +1031,18 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
//fn set_collection_ref_immediate<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, ref_: /*Ignored*/&CollectionRef, checksum: P, cancellable: Q) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_set_collection_ref_immediate() }
|
||||
//}
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn set_collection_ref_immediate<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, ref_: &CollectionRef, checksum: P, cancellable: Q) -> Result<(), Error> {
|
||||
let checksum = checksum.into();
|
||||
let checksum = checksum.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_set_collection_ref_immediate(self.to_glib_none().0, ref_.to_glib_none().0, checksum.0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn set_disable_fsync(&self, disable_fsync: bool) {
|
||||
unsafe {
|
||||
|
|
@ -932,14 +1096,28 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn static_delta_generate<'a, 'b, 'c, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b glib::Variant>>, R: Into<Option<&'c gio::Cancellable>>>(&self, opt: /*Ignored*/StaticDeltaGenerateOpt, from: &str, to: &str, metadata: P, params: Q, cancellable: R) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_static_delta_generate() }
|
||||
//}
|
||||
fn static_delta_generate<'a, 'b, 'c, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b glib::Variant>>, R: Into<Option<&'c gio::Cancellable>>>(&self, opt: StaticDeltaGenerateOpt, from: &str, to: &str, metadata: P, params: Q, cancellable: R) -> Result<(), Error> {
|
||||
let metadata = metadata.into();
|
||||
let metadata = metadata.to_glib_none();
|
||||
let params = params.into();
|
||||
let params = params.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_static_delta_generate(self.to_glib_none().0, opt.to_glib(), from.to_glib_none().0, to.to_glib_none().0, metadata.0, params.0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
//fn transaction_set_collection_ref<'a, P: Into<Option<&'a str>>>(&self, ref_: /*Ignored*/&CollectionRef, checksum: P) {
|
||||
// unsafe { TODO: call ffi::ostree_repo_transaction_set_collection_ref() }
|
||||
//}
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn transaction_set_collection_ref<'a, P: Into<Option<&'a str>>>(&self, ref_: &CollectionRef, checksum: P) {
|
||||
let checksum = checksum.into();
|
||||
let checksum = checksum.to_glib_none();
|
||||
unsafe {
|
||||
ffi::ostree_repo_transaction_set_collection_ref(self.to_glib_none().0, ref_.to_glib_none().0, checksum.0);
|
||||
}
|
||||
}
|
||||
|
||||
fn transaction_set_ref<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>>(&self, remote: P, ref_: &str, checksum: Q) {
|
||||
let remote = remote.into();
|
||||
|
|
@ -991,25 +1169,70 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn verify_commit_ext<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: IsA<gio::File> + 'b, S: Into<Option<&'b R>>, T: Into<Option<&'c gio::Cancellable>>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result</*Ignored*/GpgVerifyResult, Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_verify_commit_ext() }
|
||||
//}
|
||||
fn verify_commit_ext<'a, 'b, 'c, P: IsA<gio::File> + 'a, Q: Into<Option<&'a P>>, R: IsA<gio::File> + 'b, S: Into<Option<&'b R>>, T: Into<Option<&'c gio::Cancellable>>>(&self, commit_checksum: &str, keyringdir: Q, extra_keyring: S, cancellable: T) -> Result<GpgVerifyResult, Error> {
|
||||
let keyringdir = keyringdir.into();
|
||||
let keyringdir = keyringdir.to_glib_none();
|
||||
let extra_keyring = extra_keyring.into();
|
||||
let extra_keyring = extra_keyring.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ffi::ostree_repo_verify_commit_ext(self.to_glib_none().0, commit_checksum.to_glib_none().0, keyringdir.0, extra_keyring.0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn verify_commit_for_remote<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, remote_name: &str, cancellable: P) -> Result</*Ignored*/GpgVerifyResult, Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_verify_commit_for_remote() }
|
||||
//}
|
||||
fn verify_commit_for_remote<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, commit_checksum: &str, remote_name: &str, cancellable: P) -> Result<GpgVerifyResult, Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ffi::ostree_repo_verify_commit_for_remote(self.to_glib_none().0, commit_checksum.to_glib_none().0, remote_name.to_glib_none().0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn verify_summary<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, remote_name: &str, summary: /*Ignored*/&glib::Bytes, signatures: /*Ignored*/&glib::Bytes, cancellable: P) -> Result</*Ignored*/GpgVerifyResult, Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_verify_summary() }
|
||||
//}
|
||||
fn verify_summary<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, remote_name: &str, summary: &glib::Bytes, signatures: &glib::Bytes, cancellable: P) -> Result<GpgVerifyResult, Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ffi::ostree_repo_verify_summary(self.to_glib_none().0, remote_name.to_glib_none().0, summary.to_glib_none().0, signatures.to_glib_none().0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn write_archive_to_mtree<'a, 'b, P: IsA<gio::File>, Q: Into<Option<&'a /*Ignored*/RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, archive: &P, mtree: /*Ignored*/&MutableTree, modifier: Q, autocreate_parents: bool, cancellable: R) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_write_archive_to_mtree() }
|
||||
//}
|
||||
fn write_archive_to_mtree<'a, 'b, P: IsA<gio::File>, Q: Into<Option<&'a RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, archive: &P, mtree: &MutableTree, modifier: Q, autocreate_parents: bool, cancellable: R) -> Result<(), Error> {
|
||||
let modifier = modifier.into();
|
||||
let modifier = modifier.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_write_archive_to_mtree(self.to_glib_none().0, archive.to_glib_none().0, mtree.to_glib_none().0, modifier.0, autocreate_parents.to_glib(), cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn write_commit<'a, 'b, 'c, 'd, 'e, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c str>>, S: Into<Option<&'d glib::Variant>>, T: Into<Option<&'e gio::Cancellable>>>(&self, parent: P, subject: Q, body: R, metadata: S, root: /*Ignored*/&RepoFile, cancellable: T) -> Result<String, Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_write_commit() }
|
||||
//}
|
||||
fn write_commit<'a, 'b, 'c, 'd, 'e, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c str>>, S: Into<Option<&'d glib::Variant>>, T: Into<Option<&'e gio::Cancellable>>>(&self, parent: P, subject: Q, body: R, metadata: S, root: &RepoFile, cancellable: T) -> Result<String, Error> {
|
||||
let parent = parent.into();
|
||||
let parent = parent.to_glib_none();
|
||||
let subject = subject.into();
|
||||
let subject = subject.to_glib_none();
|
||||
let body = body.into();
|
||||
let body = body.to_glib_none();
|
||||
let metadata = metadata.into();
|
||||
let metadata = metadata.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut out_commit = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_write_commit(self.to_glib_none().0, parent.0, subject.0, body.0, metadata.0, root.to_glib_none().0, &mut out_commit, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(out_commit)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn write_commit_detached_metadata<'a, 'b, P: Into<Option<&'a glib::Variant>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, checksum: &str, metadata: P, cancellable: Q) -> Result<(), Error> {
|
||||
let metadata = metadata.into();
|
||||
|
|
@ -1023,37 +1246,84 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn write_commit_with_time<'a, 'b, 'c, 'd, 'e, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c str>>, S: Into<Option<&'d glib::Variant>>, T: Into<Option<&'e gio::Cancellable>>>(&self, parent: P, subject: Q, body: R, metadata: S, root: /*Ignored*/&RepoFile, time: u64, cancellable: T) -> Result<String, Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_write_commit_with_time() }
|
||||
//}
|
||||
fn write_commit_with_time<'a, 'b, 'c, 'd, 'e, P: Into<Option<&'a str>>, Q: Into<Option<&'b str>>, R: Into<Option<&'c str>>, S: Into<Option<&'d glib::Variant>>, T: Into<Option<&'e gio::Cancellable>>>(&self, parent: P, subject: Q, body: R, metadata: S, root: &RepoFile, time: u64, cancellable: T) -> Result<String, Error> {
|
||||
let parent = parent.into();
|
||||
let parent = parent.to_glib_none();
|
||||
let subject = subject.into();
|
||||
let subject = subject.to_glib_none();
|
||||
let body = body.into();
|
||||
let body = body.to_glib_none();
|
||||
let metadata = metadata.into();
|
||||
let metadata = metadata.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut out_commit = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_write_commit_with_time(self.to_glib_none().0, parent.0, subject.0, body.0, metadata.0, root.to_glib_none().0, time, &mut out_commit, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(out_commit)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn write_config(&self, new_config: /*Ignored*/&glib::KeyFile) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_write_config() }
|
||||
//}
|
||||
fn write_config(&self, new_config: &glib::KeyFile) -> Result<(), Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_write_config(self.to_glib_none().0, new_config.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn write_content<'a, 'b, P: Into<Option<&'a str>>, Q: IsA</*Ignored*/gio::InputStream>, R: Into<Option<&'b gio::Cancellable>>>(&self, expected_checksum: P, object_input: &Q, length: u64, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: R) -> Result<(), Error> {
|
||||
//fn write_content<'a, 'b, P: Into<Option<&'a str>>, Q: IsA<gio::InputStream>, R: Into<Option<&'b gio::Cancellable>>>(&self, expected_checksum: P, object_input: &Q, length: u64, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: R) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_write_content() }
|
||||
//}
|
||||
|
||||
//fn write_content_trusted<'a, P: IsA</*Ignored*/gio::InputStream>, Q: Into<Option<&'a gio::Cancellable>>>(&self, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_write_content_trusted() }
|
||||
//}
|
||||
fn write_content_trusted<'a, P: IsA<gio::InputStream>, Q: Into<Option<&'a gio::Cancellable>>>(&self, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_write_content_trusted(self.to_glib_none().0, checksum.to_glib_none().0, object_input.to_glib_none().0, length, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn write_dfd_to_mtree<'a, 'b, P: Into<Option<&'a /*Ignored*/RepoCommitModifier>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, dfd: i32, path: &str, mtree: /*Ignored*/&MutableTree, modifier: P, cancellable: Q) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_write_dfd_to_mtree() }
|
||||
//}
|
||||
fn write_dfd_to_mtree<'a, 'b, P: Into<Option<&'a RepoCommitModifier>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, dfd: i32, path: &str, mtree: &MutableTree, modifier: P, cancellable: Q) -> Result<(), Error> {
|
||||
let modifier = modifier.into();
|
||||
let modifier = modifier.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_write_dfd_to_mtree(self.to_glib_none().0, dfd, path.to_glib_none().0, mtree.to_glib_none().0, modifier.0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn write_directory_to_mtree<'a, 'b, P: IsA<gio::File>, Q: Into<Option<&'a /*Ignored*/RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, dir: &P, mtree: /*Ignored*/&MutableTree, modifier: Q, cancellable: R) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_write_directory_to_mtree() }
|
||||
//}
|
||||
fn write_directory_to_mtree<'a, 'b, P: IsA<gio::File>, Q: Into<Option<&'a RepoCommitModifier>>, R: Into<Option<&'b gio::Cancellable>>>(&self, dir: &P, mtree: &MutableTree, modifier: Q, cancellable: R) -> Result<(), Error> {
|
||||
let modifier = modifier.into();
|
||||
let modifier = modifier.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_write_directory_to_mtree(self.to_glib_none().0, dir.to_glib_none().0, mtree.to_glib_none().0, modifier.0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//fn write_metadata<'a, 'b, P: Into<Option<&'a str>>, Q: Into<Option<&'b gio::Cancellable>>>(&self, objtype: ObjectType, expected_checksum: P, object: &glib::Variant, out_csum: /*Unknown conversion*//*Unimplemented*/FixedArray TypeId { ns_id: 0, id: 3 }; 32, cancellable: Q) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_write_metadata() }
|
||||
//}
|
||||
|
||||
//fn write_metadata_stream_trusted<'a, P: IsA</*Ignored*/gio::InputStream>, Q: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_write_metadata_stream_trusted() }
|
||||
//}
|
||||
fn write_metadata_stream_trusted<'a, P: IsA<gio::InputStream>, Q: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, object_input: &P, length: u64, cancellable: Q) -> Result<(), Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_write_metadata_stream_trusted(self.to_glib_none().0, objtype.to_glib(), checksum.to_glib_none().0, object_input.to_glib_none().0, length, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(()) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn write_metadata_trusted<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, objtype: ObjectType, checksum: &str, variant: &glib::Variant, cancellable: P) -> Result<(), Error> {
|
||||
let cancellable = cancellable.into();
|
||||
|
|
@ -1065,9 +1335,16 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn write_mtree<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, mtree: /*Ignored*/&MutableTree, cancellable: P) -> Result<gio::File, Error> {
|
||||
// unsafe { TODO: call ffi::ostree_repo_write_mtree() }
|
||||
//}
|
||||
fn write_mtree<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, mtree: &MutableTree, cancellable: P) -> Result<gio::File, Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut out_file = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
let _ = ffi::ostree_repo_write_mtree(self.to_glib_none().0, mtree.to_glib_none().0, &mut out_file, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(out_file)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_remotes_config_dir(&self) -> Option<String> {
|
||||
unsafe {
|
||||
|
|
@ -1085,7 +1362,17 @@ impl<O: IsA<Repo> + IsA<glib::object::Object>> RepoExt for O {
|
|||
}
|
||||
}
|
||||
|
||||
//fn connect_gpg_verify_result<Unsupported or ignored types>(&self, f: F) -> SignalHandlerId {
|
||||
// Ignored result: OSTree.GpgVerifyResult
|
||||
//}
|
||||
fn connect_gpg_verify_result<F: Fn(&Self, &str, &GpgVerifyResult) + 'static>(&self, f: F) -> SignalHandlerId {
|
||||
unsafe {
|
||||
let f: Box_<Box_<Fn(&Self, &str, &GpgVerifyResult) + 'static>> = Box_::new(Box_::new(f));
|
||||
connect(self.to_glib_none().0, "gpg-verify-result",
|
||||
transmute(gpg_verify_result_trampoline::<Self> as usize), Box_::into_raw(f) as *mut _)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn gpg_verify_result_trampoline<P>(this: *mut ffi::OstreeRepo, checksum: *mut libc::c_char, result: *mut ffi::OstreeGpgVerifyResult, f: glib_ffi::gpointer)
|
||||
where P: IsA<Repo> {
|
||||
let f: &&(Fn(&P, &str, &GpgVerifyResult) + 'static) = transmute(f);
|
||||
f(&Repo::from_glib_borrow(this).downcast_unchecked(), &String::from_glib_none(checksum), &from_glib_borrow(result))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
// DO NOT EDIT
|
||||
|
||||
#[cfg(any(feature = "v2017_13", feature = "dox"))]
|
||||
use RepoDevInoCache;
|
||||
use SePolicy;
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
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),
|
||||
get_type => || ffi::ostree_repo_commit_modifier_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl RepoCommitModifier {
|
||||
//pub fn new<'a, P: Into<Option<&'a /*Unimplemented*/RepoCommitFilter>>>(flags: /*Ignored*/RepoCommitModifierFlags, commit_filter: P, destroy_notify: /*Unknown conversion*//*Unimplemented*/DestroyNotify) -> RepoCommitModifier {
|
||||
// unsafe { TODO: call ffi::ostree_repo_commit_modifier_new() }
|
||||
//}
|
||||
|
||||
#[cfg(any(feature = "v2017_13", feature = "dox"))]
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_sepolicy<'a, P: Into<Option<&'a SePolicy>>>(&self, sepolicy: P) {
|
||||
let sepolicy = sepolicy.into();
|
||||
let sepolicy = sepolicy.to_glib_none();
|
||||
unsafe {
|
||||
ffi::ostree_repo_commit_modifier_set_sepolicy(self.to_glib_none().0, sepolicy.0);
|
||||
}
|
||||
}
|
||||
|
||||
//pub fn set_xattr_callback(&self, callback: /*Unknown conversion*//*Unimplemented*/RepoCommitModifierXattrCallback, destroy: /*Unknown conversion*//*Unimplemented*/DestroyNotify) {
|
||||
// unsafe { TODO: call ffi::ostree_repo_commit_modifier_set_xattr_callback() }
|
||||
//}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
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),
|
||||
get_type => || ffi::ostree_repo_devino_cache_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl RepoDevInoCache {
|
||||
pub fn new() -> RepoDevInoCache {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ostree_repo_devino_cache_new())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for RepoDevInoCache {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,104 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Error;
|
||||
use Repo;
|
||||
use ffi;
|
||||
use gio;
|
||||
use gio_ffi;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct RepoFile(Object<ffi::OstreeRepoFile, ffi::OstreeRepoFileClass>): [
|
||||
gio::File => gio_ffi::GFile,
|
||||
];
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ostree_repo_file_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
pub trait RepoFileExt {
|
||||
fn ensure_resolved(&self) -> Result<(), Error>;
|
||||
|
||||
fn get_checksum(&self) -> Option<String>;
|
||||
|
||||
fn get_repo(&self) -> Option<Repo>;
|
||||
|
||||
fn get_root(&self) -> Option<RepoFile>;
|
||||
|
||||
fn tree_get_contents(&self) -> Option<glib::Variant>;
|
||||
|
||||
fn tree_get_contents_checksum(&self) -> Option<String>;
|
||||
|
||||
fn tree_get_metadata(&self) -> Option<glib::Variant>;
|
||||
|
||||
fn tree_get_metadata_checksum(&self) -> Option<String>;
|
||||
|
||||
fn tree_set_metadata(&self, checksum: &str, metadata: &glib::Variant);
|
||||
}
|
||||
|
||||
impl<O: IsA<RepoFile>> RepoFileExt for O {
|
||||
fn ensure_resolved(&self) -> Result<(), 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)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn get_checksum(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ostree_repo_file_get_checksum(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_repo(&self) -> Option<Repo> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ostree_repo_file_get_repo(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_root(&self) -> Option<RepoFile> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ostree_repo_file_get_root(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn tree_get_contents(&self) -> Option<glib::Variant> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ostree_repo_file_tree_get_contents(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn tree_get_contents_checksum(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ostree_repo_file_tree_get_contents_checksum(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn tree_get_metadata(&self) -> Option<glib::Variant> {
|
||||
unsafe {
|
||||
from_glib_full(ffi::ostree_repo_file_tree_get_metadata(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn tree_get_metadata_checksum(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ostree_repo_file_tree_get_metadata_checksum(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use ffi;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||
pub struct RepoTransactionStats(Boxed<ffi::OstreeRepoTransactionStats>);
|
||||
|
||||
match fn {
|
||||
copy => |ptr| gobject_ffi::g_boxed_copy(ffi::ostree_repo_transaction_stats_get_type(), ptr as *mut _) as *mut ffi::OstreeRepoTransactionStats,
|
||||
free => |ptr| gobject_ffi::g_boxed_free(ffi::ostree_repo_transaction_stats_get_type(), ptr as *mut _),
|
||||
get_type => || ffi::ostree_repo_transaction_stats_get_type(),
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
// This file was generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
// DO NOT EDIT
|
||||
|
||||
use Error;
|
||||
use SePolicyRestoreconFlags;
|
||||
use ffi;
|
||||
use gio;
|
||||
use glib;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib_ffi;
|
||||
use gobject_ffi;
|
||||
use std::mem;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct SePolicy(Object<ffi::OstreeSePolicy>);
|
||||
|
||||
match fn {
|
||||
get_type => || ffi::ostree_sepolicy_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl SePolicy {
|
||||
pub fn new<'a, P: IsA<gio::File>, Q: Into<Option<&'a gio::Cancellable>>>(path: &P, cancellable: Q) -> Result<SePolicy, Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ffi::ostree_sepolicy_new(path.to_glib_none().0, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn new_at<'a, P: Into<Option<&'a gio::Cancellable>>>(rootfs_dfd: i32, cancellable: P) -> Result<SePolicy, Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ffi::ostree_sepolicy_new_at(rootfs_dfd, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
//pub fn fscreatecon_cleanup<P: Into<Option</*Unimplemented*/Fundamental: Pointer>>>(unused: P) {
|
||||
// unsafe { TODO: call ffi::ostree_sepolicy_fscreatecon_cleanup() }
|
||||
//}
|
||||
}
|
||||
|
||||
pub trait SePolicyExt {
|
||||
fn get_csum(&self) -> Option<String>;
|
||||
|
||||
fn get_label<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, relpath: &str, unix_mode: u32, cancellable: P) -> Result<String, Error>;
|
||||
|
||||
fn get_name(&self) -> Option<String>;
|
||||
|
||||
fn get_path(&self) -> Option<gio::File>;
|
||||
|
||||
fn restorecon<'a, 'b, P: Into<Option<&'a gio::FileInfo>>, Q: IsA<gio::File>, R: Into<Option<&'b gio::Cancellable>>>(&self, path: &str, info: P, target: &Q, flags: SePolicyRestoreconFlags, cancellable: R) -> Result<String, Error>;
|
||||
|
||||
fn setfscreatecon(&self, path: &str, mode: u32) -> Result<(), Error>;
|
||||
|
||||
fn get_property_rootfs_dfd(&self) -> i32;
|
||||
}
|
||||
|
||||
impl<O: IsA<SePolicy> + IsA<glib::object::Object>> SePolicyExt for O {
|
||||
fn get_csum(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ostree_sepolicy_get_csum(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_label<'a, P: Into<Option<&'a gio::Cancellable>>>(&self, relpath: &str, unix_mode: u32, cancellable: P) -> Result<String, Error> {
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
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.0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(out_label)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn get_name(&self) -> Option<String> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ostree_sepolicy_get_name(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn get_path(&self) -> Option<gio::File> {
|
||||
unsafe {
|
||||
from_glib_none(ffi::ostree_sepolicy_get_path(self.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
fn restorecon<'a, 'b, P: Into<Option<&'a gio::FileInfo>>, Q: IsA<gio::File>, R: Into<Option<&'b gio::Cancellable>>>(&self, path: &str, info: P, target: &Q, flags: SePolicyRestoreconFlags, cancellable: R) -> Result<String, Error> {
|
||||
let info = info.into();
|
||||
let info = info.to_glib_none();
|
||||
let cancellable = cancellable.into();
|
||||
let cancellable = cancellable.to_glib_none();
|
||||
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.0, target.to_glib_none().0, flags.to_glib(), &mut out_new_label, cancellable.0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(out_new_label)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn setfscreatecon(&self, path: &str, mode: u32) -> Result<(), 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)) }
|
||||
}
|
||||
}
|
||||
|
||||
fn get_property_rootfs_dfd(&self) -> i32 {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<i32 as StaticType>::static_type());
|
||||
gobject_ffi::g_object_get_property(self.to_glib_none().0, "rootfs-dfd".to_glib_none().0, value.to_glib_none_mut().0);
|
||||
value.get().unwrap()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
Generated by gir (https://github.com/gtk-rs/gir @ c385982)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
|
|
@ -1,11 +1,13 @@
|
|||
extern crate libostree_sys as ffi;
|
||||
|
||||
extern crate glib_sys as glib_ffi;
|
||||
extern crate gobject_sys as gobject_ffi;
|
||||
|
||||
extern crate gio_sys as gio_ffi;
|
||||
#[macro_use]
|
||||
extern crate glib;
|
||||
extern crate gio;
|
||||
extern crate libc;
|
||||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
|
||||
use glib::Error;
|
||||
|
||||
|
|
|
|||
|
|
@ -82,10 +82,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
name = "libostree"
|
||||
version = "0.2.0"
|
||||
dependencies = [
|
||||
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gio 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gio-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"glib-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"gobject-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libostree-sys 0.2.0",
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue