Update to 2021.2
Sync to https://github.com/ostreedev/ostree/releases/tag/v2021.2
This commit is contained in:
1 parent
9bb0dd3c4d
commit
7d15179670
15 files changed
+1034
-640
No files matched your search
@@ -0,0 +1,42 @@
|
||||
// This file was generated by gir (https://github.com/gtk-rs/gir)
|
||||
// from gir-files (https://github.com/gtk-rs/gir-files)
|
||||
// DO NOT EDIT
|
||||
|
||||
use gio;
|
||||
use glib;
|
||||
use glib::object::IsA;
|
||||
use glib::translate::*;
|
||||
use glib::GString;
|
||||
use ostree_sys;
|
||||
use std::fmt;
|
||||
use std::ptr;
|
||||
|
||||
glib_wrapper! {
|
||||
pub struct ContentWriter(Object<ostree_sys::OstreeContentWriter, ostree_sys::OstreeContentWriterClass, ContentWriterClass>) @extends gio::OutputStream;
|
||||
|
||||
match fn {
|
||||
get_type => || ostree_sys::ostree_content_writer_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
pub const NONE_CONTENT_WRITER: Option<&ContentWriter> = None;
|
||||
|
||||
pub trait ContentWriterExt: 'static {
|
||||
fn finish<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<GString, glib::Error>;
|
||||
}
|
||||
|
||||
impl<O: IsA<ContentWriter>> ContentWriterExt for O {
|
||||
fn finish<P: IsA<gio::Cancellable>>(&self, cancellable: Option<&P>) -> Result<GString, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_content_writer_finish(self.as_ref().to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for ContentWriter {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f, "ContentWriter")
|
||||
}
|
||||
}
|
||||
@@ -38,7 +38,7 @@ impl GpgVerifyResult {
|
||||
}
|
||||
}
|
||||
|
||||
//pub fn get(&self, signature_index: u32, attrs: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 29 }) -> Option<glib::Variant> {
|
||||
//pub fn get(&self, signature_index: u32, attrs: /*Unimplemented*/&CArray TypeId { ns_id: 1, id: 31 }) -> Option<glib::Variant> {
|
||||
// unsafe { TODO: call ostree_sys:ostree_gpg_verify_result_get() }
|
||||
//}
|
||||
|
||||
|
||||
@@ -9,6 +9,10 @@ pub use self::async_progress::AsyncProgressExt;
|
||||
mod bootconfig_parser;
|
||||
pub use self::bootconfig_parser::{BootconfigParser, BootconfigParserClass};
|
||||
|
||||
mod content_writer;
|
||||
pub use self::content_writer::{ContentWriter, ContentWriterClass, NONE_CONTENT_WRITER};
|
||||
pub use self::content_writer::ContentWriterExt;
|
||||
|
||||
mod deployment;
|
||||
pub use self::deployment::{Deployment, DeploymentClass};
|
||||
|
||||
@@ -179,6 +183,7 @@ pub use self::constants::TREE_GVARIANT_STRING;
|
||||
#[doc(hidden)]
|
||||
pub mod traits {
|
||||
pub use super::AsyncProgressExt;
|
||||
pub use super::ContentWriterExt;
|
||||
pub use super::MutableTreeExt;
|
||||
pub use super::RepoFileExt;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
|
||||
@@ -60,7 +60,7 @@ pub trait MutableTreeExt: 'static {
|
||||
|
||||
fn get_metadata_checksum(&self) -> Option<GString>;
|
||||
|
||||
//fn get_subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 42 };
|
||||
//fn get_subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 44 };
|
||||
|
||||
fn lookup(&self, name: &str) -> Result<(GString, MutableTree), glib::Error>;
|
||||
|
||||
@@ -127,7 +127,7 @@ impl<O: IsA<MutableTree>> MutableTreeExt for O {
|
||||
}
|
||||
}
|
||||
|
||||
//fn get_subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 42 } {
|
||||
//fn get_subdirs(&self) -> /*Unknown conversion*//*Unimplemented*/HashTable TypeId { ns_id: 0, id: 28 }/TypeId { ns_id: 1, id: 44 } {
|
||||
// unsafe { TODO: call ostree_sys:ostree_mutable_tree_get_subdirs() }
|
||||
//}
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ use std::ptr;
|
||||
use AsyncProgress;
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use CollectionRef;
|
||||
#[cfg(any(feature = "v2021_2", feature = "dox"))]
|
||||
use ContentWriter;
|
||||
use GpgVerifyResult;
|
||||
use MutableTree;
|
||||
use ObjectType;
|
||||
@@ -434,7 +436,7 @@ impl Repo {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn load_variant_if_exists(&self, objtype: ObjectType, sha256: &str) -> Result<glib::Variant, glib::Error> {
|
||||
pub fn load_variant_if_exists(&self, objtype: ObjectType, sha256: &str) -> Result<Option<glib::Variant>, glib::Error> {
|
||||
unsafe {
|
||||
let mut out_variant = ptr::null_mut();
|
||||
let mut error = ptr::null_mut();
|
||||
@@ -998,6 +1000,34 @@ impl Repo {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2021_2", feature = "dox"))]
|
||||
pub fn write_regfile(&self, expected_checksum: Option<&str>, uid: u32, gid: u32, mode: u32, content_len: u64, xattrs: Option<&glib::Variant>) -> Result<ContentWriter, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_repo_write_regfile(self.to_glib_none().0, expected_checksum.to_glib_none().0, uid, gid, mode, content_len, xattrs.to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2021_2", feature = "dox"))]
|
||||
pub fn write_regfile_inline<P: IsA<gio::Cancellable>>(&self, expected_checksum: Option<&str>, uid: u32, gid: u32, mode: u32, xattrs: Option<&glib::Variant>, buf: &[u8], cancellable: Option<&P>) -> Result<GString, glib::Error> {
|
||||
let len = buf.len() as usize;
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_repo_write_regfile_inline(self.to_glib_none().0, expected_checksum.to_glib_none().0, uid, gid, mode, xattrs.to_glib_none().0, buf.to_glib_none().0, len, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2021_2", feature = "dox"))]
|
||||
pub fn write_symlink<P: IsA<gio::Cancellable>>(&self, expected_checksum: Option<&str>, uid: u32, gid: u32, xattrs: Option<&glib::Variant>, symlink_target: &str, cancellable: Option<&P>) -> Result<GString, glib::Error> {
|
||||
unsafe {
|
||||
let mut error = ptr::null_mut();
|
||||
let ret = ostree_sys::ostree_repo_write_symlink(self.to_glib_none().0, expected_checksum.to_glib_none().0, uid, gid, xattrs.to_glib_none().0, symlink_target.to_glib_none().0, cancellable.map(|p| p.as_ref()).to_glib_none().0, &mut error);
|
||||
if error.is_null() { Ok(from_glib_full(ret)) } else { Err(from_glib_full(error)) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_property_remotes_config_dir(&self) -> Option<GString> {
|
||||
unsafe {
|
||||
let mut value = Value::from_type(<GString as StaticType>::static_type());
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 2d1ffab)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ 9fe8b26)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ e4bcf9b+)
|
||||
Reference in new issue
Block a user