mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-03 05:18:24 +03:00
Enable trust_return_value_nullability
Several commonly used APIs currently unnecessarily return `Option<T>`, like `ostree_deployment_get_csum()`. Flip the gir flag for this to on; I think our annotations are correct.
This commit is contained in:
parent
4238ef4c68
commit
351d9ffbdc
@ -11,6 +11,7 @@ target_path = ".."
|
|||||||
doc_target_path = "../target/vendor.md"
|
doc_target_path = "../target/vendor.md"
|
||||||
deprecate_by_min_version = true
|
deprecate_by_min_version = true
|
||||||
single_version_file = true
|
single_version_file = true
|
||||||
|
trust_return_value_nullability = true
|
||||||
generate_display_trait = true
|
generate_display_trait = true
|
||||||
|
|
||||||
girs_directories = [ "../gir-files" ]
|
girs_directories = [ "../gir-files" ]
|
||||||
|
2
rust-bindings/src/auto/bootconfig_parser.rs
generated
2
rust-bindings/src/auto/bootconfig_parser.rs
generated
@ -26,7 +26,7 @@ impl BootconfigParser {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_bootconfig_parser_clone")]
|
#[doc(alias = "ostree_bootconfig_parser_clone")]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn clone(&self) -> Option<BootconfigParser> {
|
pub fn clone(&self) -> BootconfigParser {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_bootconfig_parser_clone(self.to_glib_none().0))
|
from_glib_full(ffi::ostree_bootconfig_parser_clone(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
|
2
rust-bindings/src/auto/collection_ref.rs
generated
2
rust-bindings/src/auto/collection_ref.rs
generated
@ -18,7 +18,7 @@ glib::wrapper! {
|
|||||||
|
|
||||||
impl CollectionRef {
|
impl CollectionRef {
|
||||||
#[doc(alias = "ostree_collection_ref_new")]
|
#[doc(alias = "ostree_collection_ref_new")]
|
||||||
pub fn new(collection_id: Option<&str>, ref_name: &str) -> Option<CollectionRef> {
|
pub fn new(collection_id: Option<&str>, ref_name: &str) -> CollectionRef {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_collection_ref_new(collection_id.to_glib_none().0, ref_name.to_glib_none().0))
|
from_glib_full(ffi::ostree_collection_ref_new(collection_id.to_glib_none().0, ref_name.to_glib_none().0))
|
||||||
}
|
}
|
||||||
|
12
rust-bindings/src/auto/deployment.rs
generated
12
rust-bindings/src/auto/deployment.rs
generated
@ -28,7 +28,7 @@ impl Deployment {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_deployment_clone")]
|
#[doc(alias = "ostree_deployment_clone")]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn clone(&self) -> Option<Deployment> {
|
pub fn clone(&self) -> Deployment {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_deployment_clone(self.to_glib_none().0))
|
from_glib_full(ffi::ostree_deployment_clone(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -51,7 +51,7 @@ impl Deployment {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_deployment_get_bootcsum")]
|
#[doc(alias = "ostree_deployment_get_bootcsum")]
|
||||||
#[doc(alias = "get_bootcsum")]
|
#[doc(alias = "get_bootcsum")]
|
||||||
pub fn bootcsum(&self) -> Option<glib::GString> {
|
pub fn bootcsum(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_deployment_get_bootcsum(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_deployment_get_bootcsum(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -67,7 +67,7 @@ impl Deployment {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_deployment_get_csum")]
|
#[doc(alias = "ostree_deployment_get_csum")]
|
||||||
#[doc(alias = "get_csum")]
|
#[doc(alias = "get_csum")]
|
||||||
pub fn csum(&self) -> Option<glib::GString> {
|
pub fn csum(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_deployment_get_csum(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_deployment_get_csum(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -99,7 +99,7 @@ impl Deployment {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_deployment_get_origin_relpath")]
|
#[doc(alias = "ostree_deployment_get_origin_relpath")]
|
||||||
#[doc(alias = "get_origin_relpath")]
|
#[doc(alias = "get_origin_relpath")]
|
||||||
pub fn origin_relpath(&self) -> Option<glib::GString> {
|
pub fn origin_relpath(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_deployment_get_origin_relpath(self.to_glib_none().0))
|
from_glib_full(ffi::ostree_deployment_get_origin_relpath(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ impl Deployment {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_deployment_get_osname")]
|
#[doc(alias = "ostree_deployment_get_osname")]
|
||||||
#[doc(alias = "get_osname")]
|
#[doc(alias = "get_osname")]
|
||||||
pub fn osname(&self) -> Option<glib::GString> {
|
pub fn osname(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_deployment_get_osname(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_deployment_get_osname(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ impl Deployment {
|
|||||||
#[cfg(any(feature = "v2016_4", feature = "dox"))]
|
#[cfg(any(feature = "v2016_4", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_4")))]
|
||||||
#[doc(alias = "ostree_deployment_unlocked_state_to_string")]
|
#[doc(alias = "ostree_deployment_unlocked_state_to_string")]
|
||||||
pub fn unlocked_state_to_string(state: DeploymentUnlockedState) -> Option<glib::GString> {
|
pub fn unlocked_state_to_string(state: DeploymentUnlockedState) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_deployment_unlocked_state_to_string(state.into_glib()))
|
from_glib_none(ffi::ostree_deployment_unlocked_state_to_string(state.into_glib()))
|
||||||
}
|
}
|
||||||
|
16
rust-bindings/src/auto/functions.rs
generated
16
rust-bindings/src/auto/functions.rs
generated
@ -46,14 +46,14 @@ pub fn check_version(required_year: u32, required_release: u32) -> bool {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
#[doc(alias = "ostree_checksum_from_bytes_v")]
|
#[doc(alias = "ostree_checksum_from_bytes_v")]
|
||||||
pub fn checksum_from_bytes_v(csum_v: &glib::Variant) -> Option<glib::GString> {
|
pub fn checksum_from_bytes_v(csum_v: &glib::Variant) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_checksum_from_bytes_v(csum_v.to_glib_none().0))
|
from_glib_full(ffi::ostree_checksum_from_bytes_v(csum_v.to_glib_none().0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "ostree_checksum_to_bytes_v")]
|
#[doc(alias = "ostree_checksum_to_bytes_v")]
|
||||||
pub fn checksum_to_bytes_v(checksum: &str) -> Option<glib::Variant> {
|
pub fn checksum_to_bytes_v(checksum: &str) -> glib::Variant {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_checksum_to_bytes_v(checksum.to_glib_none().0))
|
from_glib_full(ffi::ostree_checksum_to_bytes_v(checksum.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ pub fn commit_get_object_sizes(commit_variant: &glib::Variant) -> Result<Vec<Com
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "ostree_commit_get_parent")]
|
#[doc(alias = "ostree_commit_get_parent")]
|
||||||
pub fn commit_get_parent(commit_variant: &glib::Variant) -> Option<glib::GString> {
|
pub fn commit_get_parent(commit_variant: &glib::Variant) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_commit_get_parent(commit_variant.to_glib_none().0))
|
from_glib_full(ffi::ostree_commit_get_parent(commit_variant.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ pub fn content_stream_parse(compressed: bool, input: &impl IsA<gio::InputStream>
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "ostree_create_directory_metadata")]
|
#[doc(alias = "ostree_create_directory_metadata")]
|
||||||
pub fn create_directory_metadata(dir_info: &gio::FileInfo, xattrs: Option<&glib::Variant>) -> Option<glib::Variant> {
|
pub fn create_directory_metadata(dir_info: &gio::FileInfo, xattrs: Option<&glib::Variant>) -> glib::Variant {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_create_directory_metadata(dir_info.to_glib_none().0, xattrs.to_glib_none().0))
|
from_glib_full(ffi::ostree_create_directory_metadata(dir_info.to_glib_none().0, xattrs.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -202,7 +202,7 @@ pub fn gpg_error_quark() -> glib::Quark {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "ostree_metadata_variant_type")]
|
#[doc(alias = "ostree_metadata_variant_type")]
|
||||||
pub fn metadata_variant_type(objtype: ObjectType) -> Option<glib::VariantType> {
|
pub fn metadata_variant_type(objtype: ObjectType) -> glib::VariantType {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_metadata_variant_type(objtype.into_glib()))
|
from_glib_none(ffi::ostree_metadata_variant_type(objtype.into_glib()))
|
||||||
}
|
}
|
||||||
@ -229,14 +229,14 @@ pub fn object_name_deserialize(variant: &glib::Variant) -> (glib::GString, Objec
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "ostree_object_name_serialize")]
|
#[doc(alias = "ostree_object_name_serialize")]
|
||||||
pub fn object_name_serialize(checksum: &str, objtype: ObjectType) -> Option<glib::Variant> {
|
pub fn object_name_serialize(checksum: &str, objtype: ObjectType) -> glib::Variant {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_object_name_serialize(checksum.to_glib_none().0, objtype.into_glib()))
|
from_glib_none(ffi::ostree_object_name_serialize(checksum.to_glib_none().0, objtype.into_glib()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "ostree_object_to_string")]
|
#[doc(alias = "ostree_object_to_string")]
|
||||||
pub fn object_to_string(checksum: &str, objtype: ObjectType) -> Option<glib::GString> {
|
pub fn object_to_string(checksum: &str, objtype: ObjectType) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_object_to_string(checksum.to_glib_none().0, objtype.into_glib()))
|
from_glib_full(ffi::ostree_object_to_string(checksum.to_glib_none().0, objtype.into_glib()))
|
||||||
}
|
}
|
||||||
@ -250,7 +250,7 @@ pub fn object_type_from_string(str: &str) -> ObjectType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "ostree_object_type_to_string")]
|
#[doc(alias = "ostree_object_type_to_string")]
|
||||||
pub fn object_type_to_string(objtype: ObjectType) -> Option<glib::GString> {
|
pub fn object_type_to_string(objtype: ObjectType) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_object_type_to_string(objtype.into_glib()))
|
from_glib_none(ffi::ostree_object_type_to_string(objtype.into_glib()))
|
||||||
}
|
}
|
||||||
|
4
rust-bindings/src/auto/gpg_verify_result.rs
generated
4
rust-bindings/src/auto/gpg_verify_result.rs
generated
@ -34,13 +34,13 @@ impl GpgVerifyResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//#[doc(alias = "ostree_gpg_verify_result_get")]
|
//#[doc(alias = "ostree_gpg_verify_result_get")]
|
||||||
//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: 29 }) -> glib::Variant {
|
||||||
// unsafe { TODO: call ffi:ostree_gpg_verify_result_get() }
|
// unsafe { TODO: call ffi:ostree_gpg_verify_result_get() }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
#[doc(alias = "ostree_gpg_verify_result_get_all")]
|
#[doc(alias = "ostree_gpg_verify_result_get_all")]
|
||||||
#[doc(alias = "get_all")]
|
#[doc(alias = "get_all")]
|
||||||
pub fn all(&self, signature_index: u32) -> Option<glib::Variant> {
|
pub fn all(&self, signature_index: u32) -> glib::Variant {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_gpg_verify_result_get_all(self.to_glib_none().0, signature_index))
|
from_glib_none(ffi::ostree_gpg_verify_result_get_all(self.to_glib_none().0, signature_index))
|
||||||
}
|
}
|
||||||
|
4
rust-bindings/src/auto/mutable_tree.rs
generated
4
rust-bindings/src/auto/mutable_tree.rs
generated
@ -93,7 +93,7 @@ impl MutableTree {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_mutable_tree_get_contents_checksum")]
|
#[doc(alias = "ostree_mutable_tree_get_contents_checksum")]
|
||||||
#[doc(alias = "get_contents_checksum")]
|
#[doc(alias = "get_contents_checksum")]
|
||||||
pub fn contents_checksum(&self) -> Option<glib::GString> {
|
pub fn contents_checksum(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_mutable_tree_get_contents_checksum(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_mutable_tree_get_contents_checksum(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ impl MutableTree {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_mutable_tree_get_metadata_checksum")]
|
#[doc(alias = "ostree_mutable_tree_get_metadata_checksum")]
|
||||||
#[doc(alias = "get_metadata_checksum")]
|
#[doc(alias = "get_metadata_checksum")]
|
||||||
pub fn metadata_checksum(&self) -> Option<glib::GString> {
|
pub fn metadata_checksum(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_mutable_tree_get_metadata_checksum(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_mutable_tree_get_metadata_checksum(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
|
12
rust-bindings/src/auto/remote.rs
generated
12
rust-bindings/src/auto/remote.rs
generated
@ -3,6 +3,7 @@
|
|||||||
// DO NOT EDIT
|
// DO NOT EDIT
|
||||||
|
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
|
use std::fmt;
|
||||||
|
|
||||||
glib::wrapper! {
|
glib::wrapper! {
|
||||||
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
|
||||||
@ -18,7 +19,7 @@ glib::wrapper! {
|
|||||||
impl Remote {
|
impl Remote {
|
||||||
#[doc(alias = "ostree_remote_get_name")]
|
#[doc(alias = "ostree_remote_get_name")]
|
||||||
#[doc(alias = "get_name")]
|
#[doc(alias = "get_name")]
|
||||||
pub fn name(&self) -> Option<glib::GString> {
|
pub fn name(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_remote_get_name(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_remote_get_name(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -26,9 +27,16 @@ impl Remote {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_remote_get_url")]
|
#[doc(alias = "ostree_remote_get_url")]
|
||||||
#[doc(alias = "get_url")]
|
#[doc(alias = "get_url")]
|
||||||
pub fn url(&self) -> Option<glib::GString> {
|
pub fn url(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_remote_get_url(self.to_glib_none().0))
|
from_glib_full(ffi::ostree_remote_get_url(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl fmt::Display for Remote {
|
||||||
|
#[inline]
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
|
f.write_str(&self.name())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
14
rust-bindings/src/auto/repo.rs
generated
14
rust-bindings/src/auto/repo.rs
generated
@ -161,7 +161,7 @@ impl Repo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "ostree_repo_copy_config")]
|
#[doc(alias = "ostree_repo_copy_config")]
|
||||||
pub fn copy_config(&self) -> Option<glib::KeyFile> {
|
pub fn copy_config(&self) -> glib::KeyFile {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_repo_copy_config(self.to_glib_none().0))
|
from_glib_full(ffi::ostree_repo_copy_config(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -217,7 +217,7 @@ impl Repo {
|
|||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_2")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2019_2")))]
|
||||||
#[doc(alias = "ostree_repo_get_bootloader")]
|
#[doc(alias = "ostree_repo_get_bootloader")]
|
||||||
#[doc(alias = "get_bootloader")]
|
#[doc(alias = "get_bootloader")]
|
||||||
pub fn bootloader(&self) -> Option<glib::GString> {
|
pub fn bootloader(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_repo_get_bootloader(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_repo_get_bootloader(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -235,7 +235,7 @@ impl Repo {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_repo_get_config")]
|
#[doc(alias = "ostree_repo_get_config")]
|
||||||
#[doc(alias = "get_config")]
|
#[doc(alias = "get_config")]
|
||||||
pub fn config(&self) -> Option<glib::KeyFile> {
|
pub fn config(&self) -> glib::KeyFile {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_repo_get_config(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_repo_get_config(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -302,7 +302,7 @@ impl Repo {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_repo_get_path")]
|
#[doc(alias = "ostree_repo_get_path")]
|
||||||
#[doc(alias = "get_path")]
|
#[doc(alias = "get_path")]
|
||||||
pub fn path(&self) -> Option<gio::File> {
|
pub fn path(&self) -> gio::File {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_repo_get_path(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_repo_get_path(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -340,7 +340,7 @@ impl Repo {
|
|||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))]
|
||||||
#[doc(alias = "ostree_repo_get_remote_option")]
|
#[doc(alias = "ostree_repo_get_remote_option")]
|
||||||
#[doc(alias = "get_remote_option")]
|
#[doc(alias = "get_remote_option")]
|
||||||
pub fn remote_option(&self, remote_name: &str, option_name: &str, default_value: Option<&str>) -> Result<glib::GString, glib::Error> {
|
pub fn remote_option(&self, remote_name: &str, option_name: &str, default_value: Option<&str>) -> Result<Option<glib::GString>, glib::Error> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut out_value = ptr::null_mut();
|
let mut out_value = ptr::null_mut();
|
||||||
let mut error = ptr::null_mut();
|
let mut error = ptr::null_mut();
|
||||||
@ -353,7 +353,7 @@ impl Repo {
|
|||||||
#[cfg(any(feature = "v2020_8", feature = "dox"))]
|
#[cfg(any(feature = "v2020_8", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_8")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_8")))]
|
||||||
#[doc(alias = "ostree_repo_gpg_sign_data")]
|
#[doc(alias = "ostree_repo_gpg_sign_data")]
|
||||||
pub fn gpg_sign_data(&self, data: &glib::Bytes, old_signatures: &glib::Bytes, key_id: &[&str], homedir: Option<&str>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::Bytes, glib::Error> {
|
pub fn gpg_sign_data(&self, data: &glib::Bytes, old_signatures: Option<&glib::Bytes>, key_id: &[&str], homedir: Option<&str>, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::Bytes, glib::Error> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut out_signatures = ptr::null_mut();
|
let mut out_signatures = ptr::null_mut();
|
||||||
let mut error = ptr::null_mut();
|
let mut error = ptr::null_mut();
|
||||||
@ -1001,7 +1001,7 @@ impl Repo {
|
|||||||
#[cfg(any(feature = "v2021_4", feature = "dox"))]
|
#[cfg(any(feature = "v2021_4", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2021_4")))]
|
||||||
#[doc(alias = "ostree_repo_signature_verify_commit_data")]
|
#[doc(alias = "ostree_repo_signature_verify_commit_data")]
|
||||||
pub fn signature_verify_commit_data(&self, remote_name: &str, commit_data: &glib::Bytes, commit_metadata: &glib::Bytes, flags: RepoVerifyFlags) -> Result<Option<glib::GString>, glib::Error> {
|
pub fn signature_verify_commit_data(&self, remote_name: &str, commit_data: &glib::Bytes, commit_metadata: &glib::Bytes, flags: RepoVerifyFlags) -> Result<glib::GString, glib::Error> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut out_results = ptr::null_mut();
|
let mut out_results = ptr::null_mut();
|
||||||
let mut error = ptr::null_mut();
|
let mut error = ptr::null_mut();
|
||||||
|
14
rust-bindings/src/auto/repo_file.rs
generated
14
rust-bindings/src/auto/repo_file.rs
generated
@ -31,7 +31,7 @@ impl RepoFile {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_repo_file_get_checksum")]
|
#[doc(alias = "ostree_repo_file_get_checksum")]
|
||||||
#[doc(alias = "get_checksum")]
|
#[doc(alias = "get_checksum")]
|
||||||
pub fn checksum(&self) -> Option<glib::GString> {
|
pub fn checksum(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_repo_file_get_checksum(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_repo_file_get_checksum(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@ impl RepoFile {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_repo_file_get_repo")]
|
#[doc(alias = "ostree_repo_file_get_repo")]
|
||||||
#[doc(alias = "get_repo")]
|
#[doc(alias = "get_repo")]
|
||||||
pub fn repo(&self) -> Option<Repo> {
|
pub fn repo(&self) -> Repo {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_repo_file_get_repo(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_repo_file_get_repo(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -48,7 +48,7 @@ impl RepoFile {
|
|||||||
#[doc(alias = "ostree_repo_file_get_root")]
|
#[doc(alias = "ostree_repo_file_get_root")]
|
||||||
#[doc(alias = "get_root")]
|
#[doc(alias = "get_root")]
|
||||||
#[must_use]
|
#[must_use]
|
||||||
pub fn root(&self) -> Option<RepoFile> {
|
pub fn root(&self) -> RepoFile {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_repo_file_get_root(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_repo_file_get_root(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -77,28 +77,28 @@ impl RepoFile {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "ostree_repo_file_tree_get_contents")]
|
#[doc(alias = "ostree_repo_file_tree_get_contents")]
|
||||||
pub fn tree_get_contents(&self) -> Option<glib::Variant> {
|
pub fn tree_get_contents(&self) -> glib::Variant {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_repo_file_tree_get_contents(self.to_glib_none().0))
|
from_glib_full(ffi::ostree_repo_file_tree_get_contents(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "ostree_repo_file_tree_get_contents_checksum")]
|
#[doc(alias = "ostree_repo_file_tree_get_contents_checksum")]
|
||||||
pub fn tree_get_contents_checksum(&self) -> Option<glib::GString> {
|
pub fn tree_get_contents_checksum(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_repo_file_tree_get_contents_checksum(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_repo_file_tree_get_contents_checksum(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "ostree_repo_file_tree_get_metadata")]
|
#[doc(alias = "ostree_repo_file_tree_get_metadata")]
|
||||||
pub fn tree_get_metadata(&self) -> Option<glib::Variant> {
|
pub fn tree_get_metadata(&self) -> glib::Variant {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_repo_file_tree_get_metadata(self.to_glib_none().0))
|
from_glib_full(ffi::ostree_repo_file_tree_get_metadata(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "ostree_repo_file_tree_get_metadata_checksum")]
|
#[doc(alias = "ostree_repo_file_tree_get_metadata_checksum")]
|
||||||
pub fn tree_get_metadata_checksum(&self) -> Option<glib::GString> {
|
pub fn tree_get_metadata_checksum(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_repo_file_tree_get_metadata_checksum(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_repo_file_tree_get_metadata_checksum(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
|
17
rust-bindings/src/auto/se_policy.rs
generated
17
rust-bindings/src/auto/se_policy.rs
generated
@ -55,7 +55,7 @@ impl SePolicy {
|
|||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2016_5")))]
|
||||||
#[doc(alias = "ostree_sepolicy_get_csum")]
|
#[doc(alias = "ostree_sepolicy_get_csum")]
|
||||||
#[doc(alias = "get_csum")]
|
#[doc(alias = "get_csum")]
|
||||||
pub fn csum(&self) -> Option<glib::GString> {
|
pub fn csum(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_sepolicy_get_csum(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_sepolicy_get_csum(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -63,7 +63,7 @@ impl SePolicy {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_sepolicy_get_label")]
|
#[doc(alias = "ostree_sepolicy_get_label")]
|
||||||
#[doc(alias = "get_label")]
|
#[doc(alias = "get_label")]
|
||||||
pub fn label(&self, relpath: &str, unix_mode: u32, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::GString, glib::Error> {
|
pub fn label(&self, relpath: &str, unix_mode: u32, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Option<glib::GString>, glib::Error> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut out_label = ptr::null_mut();
|
let mut out_label = ptr::null_mut();
|
||||||
let mut error = ptr::null_mut();
|
let mut error = ptr::null_mut();
|
||||||
@ -75,7 +75,7 @@ impl SePolicy {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_sepolicy_get_name")]
|
#[doc(alias = "ostree_sepolicy_get_name")]
|
||||||
#[doc(alias = "get_name")]
|
#[doc(alias = "get_name")]
|
||||||
pub fn name(&self) -> Option<glib::GString> {
|
pub fn name(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_sepolicy_get_name(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_sepolicy_get_name(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -83,14 +83,14 @@ impl SePolicy {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_sepolicy_get_path")]
|
#[doc(alias = "ostree_sepolicy_get_path")]
|
||||||
#[doc(alias = "get_path")]
|
#[doc(alias = "get_path")]
|
||||||
pub fn path(&self) -> Option<gio::File> {
|
pub fn path(&self) -> gio::File {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_sepolicy_get_path(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_sepolicy_get_path(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "ostree_sepolicy_restorecon")]
|
#[doc(alias = "ostree_sepolicy_restorecon")]
|
||||||
pub fn restorecon(&self, path: &str, info: Option<&gio::FileInfo>, target: &impl IsA<gio::File>, flags: SePolicyRestoreconFlags, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<glib::GString, glib::Error> {
|
pub fn restorecon(&self, path: &str, info: Option<&gio::FileInfo>, target: &impl IsA<gio::File>, flags: SePolicyRestoreconFlags, cancellable: Option<&impl IsA<gio::Cancellable>>) -> Result<Option<glib::GString>, glib::Error> {
|
||||||
unsafe {
|
unsafe {
|
||||||
let mut out_new_label = ptr::null_mut();
|
let mut out_new_label = ptr::null_mut();
|
||||||
let mut error = ptr::null_mut();
|
let mut error = ptr::null_mut();
|
||||||
@ -116,10 +116,11 @@ impl SePolicy {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe impl Send for SePolicy {}
|
|
||||||
|
|
||||||
impl fmt::Display for SePolicy {
|
impl fmt::Display for SePolicy {
|
||||||
|
#[inline]
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
f.write_str("SePolicy")
|
f.write_str(&self.name())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl Send for SePolicy {}
|
||||||
|
12
rust-bindings/src/auto/sign.rs
generated
12
rust-bindings/src/auto/sign.rs
generated
@ -85,7 +85,7 @@ pub trait SignExt: 'static {
|
|||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
||||||
#[doc(alias = "ostree_sign_get_name")]
|
#[doc(alias = "ostree_sign_get_name")]
|
||||||
#[doc(alias = "get_name")]
|
#[doc(alias = "get_name")]
|
||||||
fn name(&self) -> Option<glib::GString>;
|
fn name(&self) -> glib::GString;
|
||||||
|
|
||||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
||||||
@ -95,12 +95,12 @@ pub trait SignExt: 'static {
|
|||||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
||||||
#[doc(alias = "ostree_sign_metadata_format")]
|
#[doc(alias = "ostree_sign_metadata_format")]
|
||||||
fn metadata_format(&self) -> Option<glib::GString>;
|
fn metadata_format(&self) -> glib::GString;
|
||||||
|
|
||||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
||||||
#[doc(alias = "ostree_sign_metadata_key")]
|
#[doc(alias = "ostree_sign_metadata_key")]
|
||||||
fn metadata_key(&self) -> Option<glib::GString>;
|
fn metadata_key(&self) -> glib::GString;
|
||||||
|
|
||||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
||||||
@ -190,7 +190,7 @@ impl<O: IsA<Sign>> SignExt for O {
|
|||||||
|
|
||||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
||||||
fn name(&self) -> Option<glib::GString> {
|
fn name(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_sign_get_name(self.as_ref().to_glib_none().0))
|
from_glib_none(ffi::ostree_sign_get_name(self.as_ref().to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -209,7 +209,7 @@ impl<O: IsA<Sign>> SignExt for O {
|
|||||||
|
|
||||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
||||||
fn metadata_format(&self) -> Option<glib::GString> {
|
fn metadata_format(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_sign_metadata_format(self.as_ref().to_glib_none().0))
|
from_glib_none(ffi::ostree_sign_metadata_format(self.as_ref().to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -217,7 +217,7 @@ impl<O: IsA<Sign>> SignExt for O {
|
|||||||
|
|
||||||
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
#[cfg(any(feature = "v2020_2", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2020_2")))]
|
||||||
fn metadata_key(&self) -> Option<glib::GString> {
|
fn metadata_key(&self) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_sign_metadata_key(self.as_ref().to_glib_none().0))
|
from_glib_none(ffi::ostree_sign_metadata_key(self.as_ref().to_glib_none().0))
|
||||||
}
|
}
|
||||||
|
12
rust-bindings/src/auto/sysroot.rs
generated
12
rust-bindings/src/auto/sysroot.rs
generated
@ -185,7 +185,7 @@ impl Sysroot {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_sysroot_get_deployment_directory")]
|
#[doc(alias = "ostree_sysroot_get_deployment_directory")]
|
||||||
#[doc(alias = "get_deployment_directory")]
|
#[doc(alias = "get_deployment_directory")]
|
||||||
pub fn deployment_directory(&self, deployment: &Deployment) -> Option<gio::File> {
|
pub fn deployment_directory(&self, deployment: &Deployment) -> gio::File {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_sysroot_get_deployment_directory(self.to_glib_none().0, deployment.to_glib_none().0))
|
from_glib_full(ffi::ostree_sysroot_get_deployment_directory(self.to_glib_none().0, deployment.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -193,7 +193,7 @@ impl Sysroot {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_sysroot_get_deployment_dirpath")]
|
#[doc(alias = "ostree_sysroot_get_deployment_dirpath")]
|
||||||
#[doc(alias = "get_deployment_dirpath")]
|
#[doc(alias = "get_deployment_dirpath")]
|
||||||
pub fn deployment_dirpath(&self, deployment: &Deployment) -> Option<glib::GString> {
|
pub fn deployment_dirpath(&self, deployment: &Deployment) -> glib::GString {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_sysroot_get_deployment_dirpath(self.to_glib_none().0, deployment.to_glib_none().0))
|
from_glib_full(ffi::ostree_sysroot_get_deployment_dirpath(self.to_glib_none().0, deployment.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -225,7 +225,7 @@ impl Sysroot {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_sysroot_get_path")]
|
#[doc(alias = "ostree_sysroot_get_path")]
|
||||||
#[doc(alias = "get_path")]
|
#[doc(alias = "get_path")]
|
||||||
pub fn path(&self) -> Option<gio::File> {
|
pub fn path(&self) -> gio::File {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_sysroot_get_path(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_sysroot_get_path(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -369,7 +369,7 @@ impl Sysroot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[doc(alias = "ostree_sysroot_origin_new_from_refspec")]
|
#[doc(alias = "ostree_sysroot_origin_new_from_refspec")]
|
||||||
pub fn origin_new_from_refspec(&self, refspec: &str) -> Option<glib::KeyFile> {
|
pub fn origin_new_from_refspec(&self, refspec: &str) -> glib::KeyFile {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_sysroot_origin_new_from_refspec(self.to_glib_none().0, refspec.to_glib_none().0))
|
from_glib_full(ffi::ostree_sysroot_origin_new_from_refspec(self.to_glib_none().0, refspec.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -400,7 +400,7 @@ impl Sysroot {
|
|||||||
#[cfg(any(feature = "v2017_7", feature = "dox"))]
|
#[cfg(any(feature = "v2017_7", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2017_7")))]
|
||||||
#[doc(alias = "ostree_sysroot_repo")]
|
#[doc(alias = "ostree_sysroot_repo")]
|
||||||
pub fn repo(&self) -> Option<Repo> {
|
pub fn repo(&self) -> Repo {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_none(ffi::ostree_sysroot_repo(self.to_glib_none().0))
|
from_glib_none(ffi::ostree_sysroot_repo(self.to_glib_none().0))
|
||||||
}
|
}
|
||||||
@ -534,7 +534,7 @@ impl Sysroot {
|
|||||||
|
|
||||||
#[doc(alias = "ostree_sysroot_get_deployment_origin_path")]
|
#[doc(alias = "ostree_sysroot_get_deployment_origin_path")]
|
||||||
#[doc(alias = "get_deployment_origin_path")]
|
#[doc(alias = "get_deployment_origin_path")]
|
||||||
pub fn deployment_origin_path(deployment_path: &impl IsA<gio::File>) -> Option<gio::File> {
|
pub fn deployment_origin_path(deployment_path: &impl IsA<gio::File>) -> gio::File {
|
||||||
unsafe {
|
unsafe {
|
||||||
from_glib_full(ffi::ostree_sysroot_get_deployment_origin_path(deployment_path.as_ref().to_glib_none().0))
|
from_glib_full(ffi::ostree_sysroot_get_deployment_origin_path(deployment_path.as_ref().to_glib_none().0))
|
||||||
}
|
}
|
||||||
|
2
rust-bindings/src/auto/versions.txt
generated
2
rust-bindings/src/auto/versions.txt
generated
@ -1,2 +1,2 @@
|
|||||||
Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d)
|
Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d)
|
||||||
from gir-files (@ be0dbf02d770)
|
from gir-files (@ f4ba299323ae)
|
||||||
|
@ -54,7 +54,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_get_collection_id() {
|
fn should_get_collection_id() {
|
||||||
let collection_ref = CollectionRef::new(Some("collection.id"), "ref").unwrap();
|
let collection_ref = CollectionRef::new(Some("collection.id"), "ref");
|
||||||
let id = collection_ref.collection_id().unwrap().to_str().unwrap();
|
let id = collection_ref.collection_id().unwrap().to_str().unwrap();
|
||||||
|
|
||||||
assert_eq!(id, "collection.id");
|
assert_eq!(id, "collection.id");
|
||||||
@ -62,7 +62,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_get_none_collection_id() {
|
fn should_get_none_collection_id() {
|
||||||
let collection_ref = CollectionRef::new(None, "ref").unwrap();
|
let collection_ref = CollectionRef::new(None, "ref");
|
||||||
let id = collection_ref.collection_id();
|
let id = collection_ref.collection_id();
|
||||||
|
|
||||||
assert_eq!(id, None);
|
assert_eq!(id, None);
|
||||||
@ -70,7 +70,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn should_get_ref_name() {
|
fn should_get_ref_name() {
|
||||||
let collection_ref = CollectionRef::new(Some("collection.id"), "ref-name").unwrap();
|
let collection_ref = CollectionRef::new(Some("collection.id"), "ref-name");
|
||||||
let ref_name = collection_ref.ref_name().to_str().unwrap();
|
let ref_name = collection_ref.ref_name().to_str().unwrap();
|
||||||
|
|
||||||
assert_eq!(ref_name, "ref-name");
|
assert_eq!(ref_name, "ref-name");
|
||||||
|
@ -34,8 +34,7 @@ impl ObjectName {
|
|||||||
/// Create a new `ObjectName` with the given checksum and `ObjectType`.
|
/// Create a new `ObjectName` with the given checksum and `ObjectType`.
|
||||||
pub fn new<S: Into<GString>>(checksum: S, object_type: ObjectType) -> ObjectName {
|
pub fn new<S: Into<GString>>(checksum: S, object_type: ObjectType) -> ObjectName {
|
||||||
let checksum = checksum.into();
|
let checksum = checksum.into();
|
||||||
let variant = object_name_serialize(checksum.as_str(), object_type)
|
let variant = object_name_serialize(checksum.as_str(), object_type);
|
||||||
.expect("type checks should make this safe");
|
|
||||||
ObjectName {
|
ObjectName {
|
||||||
variant,
|
variant,
|
||||||
checksum,
|
checksum,
|
||||||
@ -56,7 +55,6 @@ impl ObjectName {
|
|||||||
/// Format this `ObjectName` as a string.
|
/// Format this `ObjectName` as a string.
|
||||||
fn to_string(&self) -> GString {
|
fn to_string(&self) -> GString {
|
||||||
object_to_string(self.checksum(), self.object_type())
|
object_to_string(self.checksum(), self.object_type())
|
||||||
.expect("type checks should make this safe")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ mod tests {
|
|||||||
assert_eq!(sysroot.subbootversion(), 0);
|
assert_eq!(sysroot.subbootversion(), 0);
|
||||||
sysroot.cleanup(gio::Cancellable::NONE).unwrap();
|
sysroot.cleanup(gio::Cancellable::NONE).unwrap();
|
||||||
|
|
||||||
sysroot.path().unwrap()
|
sysroot.path()
|
||||||
};
|
};
|
||||||
let path_loaded = {
|
let path_loaded = {
|
||||||
let tmp_path = Some(tmpdir.path().to_path_buf());
|
let tmp_path = Some(tmpdir.path().to_path_buf());
|
||||||
@ -100,7 +100,7 @@ mod tests {
|
|||||||
assert_eq!(sysroot.subbootversion(), 0);
|
assert_eq!(sysroot.subbootversion(), 0);
|
||||||
sysroot.cleanup(gio::Cancellable::NONE).unwrap();
|
sysroot.cleanup(gio::Cancellable::NONE).unwrap();
|
||||||
|
|
||||||
sysroot.path().unwrap()
|
sysroot.path()
|
||||||
};
|
};
|
||||||
assert_eq!(path_created.to_string(), path_loaded.to_string());
|
assert_eq!(path_created.to_string(), path_loaded.to_string());
|
||||||
}
|
}
|
||||||
|
@ -12,68 +12,62 @@ fn hash(v: &impl Hash) -> u64 {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn same_value_should_be_equal() {
|
fn same_value_should_be_equal() {
|
||||||
let r = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
|
let r = CollectionRef::new(Some("io.gitlab.fkrull"), "ref");
|
||||||
assert_eq!(r, r);
|
assert_eq!(r, r);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn equal_values_should_be_equal() {
|
fn equal_values_should_be_equal() {
|
||||||
let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
|
let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref");
|
||||||
let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
|
let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref");
|
||||||
assert_eq!(a, b);
|
assert_eq!(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn equal_values_without_collection_id_should_be_equal() {
|
fn equal_values_without_collection_id_should_be_equal() {
|
||||||
let a = CollectionRef::new(None, "ref-name").unwrap();
|
let a = CollectionRef::new(None, "ref-name");
|
||||||
let b = CollectionRef::new(None, "ref-name").unwrap();
|
let b = CollectionRef::new(None, "ref-name");
|
||||||
assert_eq!(a, b);
|
assert_eq!(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn different_values_should_not_be_equal() {
|
fn different_values_should_not_be_equal() {
|
||||||
let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref1").unwrap();
|
let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref1");
|
||||||
let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref2").unwrap();
|
let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref2");
|
||||||
assert_ne!(a, b);
|
assert_ne!(a, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn new_with_invalid_collection_id_should_return_none() {
|
|
||||||
let r = CollectionRef::new(Some(".abc"), "ref");
|
|
||||||
assert_eq!(r, None);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn hash_for_equal_values_should_be_equal() {
|
fn hash_for_equal_values_should_be_equal() {
|
||||||
let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
|
let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref");
|
||||||
let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
|
let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref");
|
||||||
assert_eq!(hash(&a), hash(&b));
|
assert_eq!(hash(&a), hash(&b));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn hash_for_values_with_different_collection_id_should_be_different() {
|
fn hash_for_values_with_different_collection_id_should_be_different() {
|
||||||
let a = CollectionRef::new(Some("io.gitlab.fkrull1"), "ref").unwrap();
|
let a = CollectionRef::new(Some("io.gitlab.fkrull1"), "ref");
|
||||||
let b = CollectionRef::new(Some("io.gitlab.fkrull2"), "ref").unwrap();
|
let b = CollectionRef::new(Some("io.gitlab.fkrull2"), "ref");
|
||||||
assert_ne!(hash(&a), hash(&b));
|
assert_ne!(hash(&a), hash(&b));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn hash_for_values_with_different_ref_id_should_be_different() {
|
fn hash_for_values_with_different_ref_id_should_be_different() {
|
||||||
let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref-1").unwrap();
|
let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref-1");
|
||||||
let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref-2").unwrap();
|
let b = CollectionRef::new(Some("io.gitlab.fkrull"), "ref-2");
|
||||||
assert_ne!(hash(&a), hash(&b));
|
assert_ne!(hash(&a), hash(&b));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn hash_should_be_different_if_collection_id_is_absent() {
|
fn hash_should_be_different_if_collection_id_is_absent() {
|
||||||
let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
|
let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref");
|
||||||
let b = CollectionRef::new(None, "ref").unwrap();
|
let b = CollectionRef::new(None, "ref");
|
||||||
assert_ne!(hash(&a), hash(&b));
|
assert_ne!(hash(&a), hash(&b));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn clone_should_be_equal_to_original_value() {
|
fn clone_should_be_equal_to_original_value() {
|
||||||
let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref").unwrap();
|
let a = CollectionRef::new(Some("io.gitlab.fkrull"), "ref");
|
||||||
let b = a.clone();
|
let b = a.clone();
|
||||||
assert_eq!(a, b);
|
assert_eq!(a, b);
|
||||||
}
|
}
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d)
|
Generated by gir (https://github.com/gtk-rs/gir @ 0eeebbdf9d4d)
|
||||||
from gir-files (@ be0dbf02d770)
|
from gir-files (@ f4ba299323ae)
|
||||||
|
@ -1255,21 +1255,21 @@ extern "C" {
|
|||||||
pub fn ostree_collection_ref_dup(ref_: *const OstreeCollectionRef) -> *mut OstreeCollectionRef;
|
pub fn ostree_collection_ref_dup(ref_: *const OstreeCollectionRef) -> *mut OstreeCollectionRef;
|
||||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||||
|
pub fn ostree_collection_ref_equal(ref1: gconstpointer, ref2: gconstpointer) -> gboolean;
|
||||||
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||||
pub fn ostree_collection_ref_free(ref_: *mut OstreeCollectionRef);
|
pub fn ostree_collection_ref_free(ref_: *mut OstreeCollectionRef);
|
||||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||||
|
pub fn ostree_collection_ref_hash(ref_: gconstpointer) -> c_uint;
|
||||||
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||||
pub fn ostree_collection_ref_dupv(
|
pub fn ostree_collection_ref_dupv(
|
||||||
refs: *const *const OstreeCollectionRef,
|
refs: *const *const OstreeCollectionRef,
|
||||||
) -> *mut *mut OstreeCollectionRef;
|
) -> *mut *mut OstreeCollectionRef;
|
||||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
||||||
pub fn ostree_collection_ref_equal(ref1: gconstpointer, ref2: gconstpointer) -> gboolean;
|
|
||||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
|
||||||
pub fn ostree_collection_ref_freev(refs: *mut *mut OstreeCollectionRef);
|
pub fn ostree_collection_ref_freev(refs: *mut *mut OstreeCollectionRef);
|
||||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
|
||||||
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2018_6")))]
|
|
||||||
pub fn ostree_collection_ref_hash(ref_: gconstpointer) -> c_uint;
|
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
// OstreeCommitSizesEntry
|
// OstreeCommitSizesEntry
|
||||||
|
@ -8,7 +8,7 @@ use ostree::{gio, glib};
|
|||||||
#[test]
|
#[test]
|
||||||
fn sign_api_should_work() {
|
fn sign_api_should_work() {
|
||||||
let dummy_sign = ostree::Sign::by_name("dummy").unwrap();
|
let dummy_sign = ostree::Sign::by_name("dummy").unwrap();
|
||||||
assert_eq!(dummy_sign.name().unwrap(), "dummy");
|
assert_eq!(dummy_sign.name(), "dummy");
|
||||||
|
|
||||||
let result = ostree::prelude::SignExt::data(
|
let result = ostree::prelude::SignExt::data(
|
||||||
&dummy_sign,
|
&dummy_sign,
|
||||||
@ -25,7 +25,7 @@ fn sign_api_should_work() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn inner_sign_ed25519<T: SignExt>(signer: T) {
|
fn inner_sign_ed25519<T: SignExt>(signer: T) {
|
||||||
assert_eq!(signer.name().unwrap(), "ed25519");
|
assert_eq!(signer.name(), "ed25519");
|
||||||
|
|
||||||
let td = tempfile::tempdir().unwrap();
|
let td = tempfile::tempdir().unwrap();
|
||||||
let path = td.path();
|
let path = td.path();
|
||||||
|
Loading…
Reference in New Issue
Block a user