Implement glib::ValueTypeOptional for various types

This commit is contained in:
Sebastian Dröge 2021-12-16 19:39:43 +02:00 committed by Sebastian Dröge
parent e448a762ca
commit 1e18c59d2a
6 changed files with 12 additions and 0 deletions

View file

@ -444,6 +444,8 @@ macro_rules! generic_impl {
type Type = Self;
}
impl glib::value::ValueTypeOptional for $name {}
#[doc(hidden)]
unsafe impl<'a> glib::value::FromValue<'a> for $name {
type Checker = glib::value::GenericValueTypeOrNoneChecker<Self>;

View file

@ -210,6 +210,8 @@ impl glib::value::ValueType for VideoTimeCodeInterval {
type Type = Self;
}
impl glib::value::ValueTypeOptional for VideoTimeCodeInterval {}
#[doc(hidden)]
unsafe impl<'a> glib::value::FromValue<'a> for VideoTimeCodeInterval {
type Checker = glib::value::GenericValueTypeOrNoneChecker<Self>;

View file

@ -235,6 +235,8 @@ impl glib::value::ValueType for CapsFeatures {
type Type = Self;
}
impl glib::value::ValueTypeOptional for CapsFeatures {}
unsafe impl<'a> glib::value::FromValue<'a> for CapsFeatures {
type Checker = glib::value::GenericValueTypeOrNoneChecker<Self>;

View file

@ -502,6 +502,8 @@ impl<T: StaticType + 'static> glib::value::ValueType for Iterator<T> {
type Type = Self;
}
impl<T: StaticType + 'static> glib::value::ValueTypeOptional for Iterator<T> {}
unsafe impl<'a, T: StaticType + 'static> glib::value::FromValue<'a> for Iterator<T> {
type Checker = glib::value::GenericValueTypeOrNoneChecker<Self>;

View file

@ -462,6 +462,8 @@ macro_rules! mini_object_wrapper (
type Type = Self;
}
impl glib::value::ValueTypeOptional for $name { }
unsafe impl<'a> $crate::glib::value::FromValue<'a> for $name {
type Checker = $crate::glib::value::GenericValueTypeOrNoneChecker<Self>;

View file

@ -306,6 +306,8 @@ impl glib::value::ValueType for Structure {
type Type = Self;
}
impl glib::value::ValueTypeOptional for Structure {}
unsafe impl<'a> glib::value::FromValue<'a> for Structure {
type Checker = glib::value::GenericValueTypeOrNoneChecker<Self>;