mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-24 00:50:34 +00:00
log: Add as_ptr() and Hash to DebugCategory
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1612>
This commit is contained in:
parent
6e9a499146
commit
a0de8269f1
1 changed files with 6 additions and 1 deletions
|
@ -68,7 +68,7 @@ impl DebugMessage {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Eq, Clone, Copy)]
|
||||
#[derive(PartialEq, Eq, Clone, Copy, Hash)]
|
||||
#[doc(alias = "GstDebugCategory")]
|
||||
#[repr(transparent)]
|
||||
pub struct DebugCategory(Option<ptr::NonNull<ffi::GstDebugCategory>>);
|
||||
|
@ -530,6 +530,11 @@ impl DebugCategory {
|
|||
))
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn as_ptr(&self) -> *mut ffi::GstDebugCategory {
|
||||
self.0.map(|p| p.as_ptr()).unwrap_or(ptr::null_mut())
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl Sync for DebugCategory {}
|
||||
|
|
Loading…
Reference in a new issue