Switch to generated CollectionRef
This commit is contained in:
1 parent
60960612a3
commit
3decba546e
11 files changed
+24
-36
No files matched your search
@@ -0,0 +1,60 @@
|
||||
// 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
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
use glib::translate::*;
|
||||
use glib_sys;
|
||||
use gobject_sys;
|
||||
use ostree_sys;
|
||||
use std::hash;
|
||||
|
||||
glib_wrapper! {
|
||||
#[derive(Debug, PartialOrd, Ord)]
|
||||
pub struct CollectionRef(Boxed<ostree_sys::OstreeCollectionRef>);
|
||||
|
||||
match fn {
|
||||
copy => |ptr| gobject_sys::g_boxed_copy(ostree_sys::ostree_collection_ref_get_type(), ptr as *mut _) as *mut ostree_sys::OstreeCollectionRef,
|
||||
free => |ptr| gobject_sys::g_boxed_free(ostree_sys::ostree_collection_ref_get_type(), ptr as *mut _),
|
||||
get_type => || ostree_sys::ostree_collection_ref_get_type(),
|
||||
}
|
||||
}
|
||||
|
||||
impl CollectionRef {
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
pub fn new(collection_id: Option<&str>, ref_name: &str) -> Option<CollectionRef> {
|
||||
unsafe {
|
||||
from_glib_full(ostree_sys::ostree_collection_ref_new(collection_id.to_glib_none().0, ref_name.to_glib_none().0))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn equal(&self, ref2: &CollectionRef) -> bool {
|
||||
unsafe {
|
||||
from_glib(ostree_sys::ostree_collection_ref_equal(ToGlibPtr::<*const ostree_sys::OstreeCollectionRef>::to_glib_none(self).0 as glib_sys::gconstpointer, ToGlibPtr::<*const ostree_sys::OstreeCollectionRef>::to_glib_none(ref2).0 as glib_sys::gconstpointer))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(feature = "v2018_6", feature = "dox"))]
|
||||
fn hash(&self) -> u32 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_collection_ref_hash(ToGlibPtr::<*const ostree_sys::OstreeCollectionRef>::to_glib_none(self).0 as glib_sys::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)
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ impl Deployment {
|
||||
|
||||
pub fn equal(&self, bp: &Deployment) -> bool {
|
||||
unsafe {
|
||||
from_glib(ostree_sys::ostree_deployment_equal(ToGlibPtr::<*mut ostree_sys::OstreeDeployment>::to_glib_none(self).0 as glib_sys::gconstpointer, ToGlibPtr::<*mut ostree_sys::OstreeDeployment>::to_glib_none(bp).0 as glib_sys::gconstpointer))
|
||||
from_glib(ostree_sys::ostree_deployment_equal(ToGlibPtr::<*const ostree_sys::OstreeDeployment>::to_glib_none(self).0 as glib_sys::gconstpointer, ToGlibPtr::<*const ostree_sys::OstreeDeployment>::to_glib_none(bp).0 as glib_sys::gconstpointer))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ impl Deployment {
|
||||
|
||||
pub fn hash(&self) -> u32 {
|
||||
unsafe {
|
||||
ostree_sys::ostree_deployment_hash(ToGlibPtr::<*mut ostree_sys::OstreeDeployment>::to_glib_none(self).0 as glib_sys::gconstpointer)
|
||||
ostree_sys::ostree_deployment_hash(ToGlibPtr::<*const ostree_sys::OstreeDeployment>::to_glib_none(self).0 as glib_sys::gconstpointer)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,11 @@ pub use self::sysroot::{Sysroot, SysrootClass};
|
||||
mod sysroot_upgrader;
|
||||
pub use self::sysroot_upgrader::{SysrootUpgrader, SysrootUpgraderClass};
|
||||
|
||||
#[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"))]
|
||||
|
||||
@@ -31,7 +31,7 @@ use glib::GString;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::IsA;
|
||||
use glib::object::ObjectType as _;
|
||||
use glib::object::ObjectType as ObjectType_;
|
||||
use glib::signal::SignalHandlerId;
|
||||
use glib::signal::connect_raw;
|
||||
use glib::translate::*;
|
||||
|
||||
@@ -9,7 +9,7 @@ use glib::GString;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::IsA;
|
||||
use glib::object::ObjectType as _;
|
||||
use glib::object::ObjectType as ObjectType_;
|
||||
use glib::translate::*;
|
||||
use gobject_sys;
|
||||
use ostree_sys;
|
||||
|
||||
@@ -16,7 +16,7 @@ use glib;
|
||||
use glib::GString;
|
||||
use glib::object::IsA;
|
||||
#[cfg(any(feature = "v2017_10", feature = "dox"))]
|
||||
use glib::object::ObjectType as _;
|
||||
use glib::object::ObjectType as ObjectType_;
|
||||
#[cfg(any(feature = "v2017_10", feature = "dox"))]
|
||||
use glib::signal::SignalHandlerId;
|
||||
#[cfg(any(feature = "v2017_10", feature = "dox"))]
|
||||
|
||||
@@ -15,7 +15,7 @@ use glib::GString;
|
||||
use glib::StaticType;
|
||||
use glib::Value;
|
||||
use glib::object::IsA;
|
||||
use glib::object::ObjectType as _;
|
||||
use glib::object::ObjectType as ObjectType_;
|
||||
use glib::translate::*;
|
||||
use gobject_sys;
|
||||
use ostree_sys;
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ fec179c)
|
||||
Generated by gir (https://github.com/gtk-rs/gir @ 1bff597)
|
||||
from gir-files (https://github.com/gtk-rs/gir-files @ ???)
|
||||
Reference in new issue
Block a user