miniobject: Implement the HasParamSpec trait in the macro

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1252>
This commit is contained in:
Thibault Saunier 2023-04-15 10:06:00 -04:00 committed by Sebastian Dröge
parent 4a60c71c84
commit 8d478c3fc9

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)
}
}
};
);