miniobject: Implement the HasParamSpec trait in the macro

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1249>
This commit is contained in:
Thibault Saunier 2023-04-15 10:06:00 -04:00
parent e026d922e4
commit 145664ec0d

View file

@ -608,6 +608,16 @@ macro_rules! mini_object_wrapper (
// Can't have SetValue/SetValueOptional impls as otherwise one could use it to get
// immutable references from a mutable reference without borrowing via the value
impl $crate::glib::HasParamSpec for $name {
type ParamSpec = $crate::glib::ParamSpecBoxed;
type SetValue = Self;
type BuilderFn = fn(&str) -> $crate::glib::ParamSpecBoxedBuilder<Self>;
fn param_spec_builder() -> Self::BuilderFn {
|name| Self::ParamSpec::builder(name)
}
}
};
);