Skip to content

Commit df0fdee

Browse files
committed
glib: Add ParamSpec::is() helper function
Fixes #502
1 parent 5e7661c commit df0fdee

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

glib/src/param_spec.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ impl ParamSpec {
148148
}
149149
}
150150

151+
#[inline]
152+
pub fn is<T: StaticType>(&self) -> bool {
153+
self.type_().is_a(T::static_type())
154+
}
155+
151156
#[doc(alias = "get_value_type")]
152157
#[inline]
153158
pub fn value_type(&self) -> crate::Type {

0 commit comments

Comments
 (0)