Build CollectionRef manually
That way we can get Eq and Hash.
This commit is contained in:
1 parent
13c61a9329
commit
8bfefa2b14
6 files changed
+86
-76
No files matched your search
@@ -1,39 +0,0 @@
|
||||
// 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 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 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))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,11 +26,6 @@ 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"))]
|
||||
|
||||
Reference in new issue
Block a user