allocator: Implement PartialEq and Eq for AllocationParams

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1667>
This commit is contained in:
Sebastian Dröge 2025-03-24 09:34:32 +02:00
parent 7a36bd2790
commit 9c55808cc4

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