mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-28 02:50:32 +00:00
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:
parent
e026d922e4
commit
145664ec0d
1 changed files with 10 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
};
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue