allocator: Implement PartialEq and Eq for AllocationParams

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1673>
This commit is contained in:
Sebastian Dröge 2025-03-24 09:34:32 +02:00 committed by GStreamer Marge Bot
parent 5e817d39c8
commit 15f1ba0c94

View file

@ -98,6 +98,17 @@ impl From<ffi::GstAllocationParams> for AllocationParams {
}
}
impl PartialEq for AllocationParams {
fn eq(&self, other: &Self) -> bool {
self.flags() == other.flags()
&& self.align() == other.align()
&& self.prefix() == other.prefix()
&& self.padding() == other.padding()
}
}
impl Eq for AllocationParams {}
#[doc(hidden)]
impl<'a> ToGlibPtr<'a, *const ffi::GstAllocationParams> for AllocationParams {
type Storage = PhantomData<&'a Self>;