mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-23 01:51:06 +00:00
gstreamer: Add Debug
impl for MiniObject
/ MiniObjectRef
This commit is contained in:
parent
b1f1c7dd4e
commit
849440403c
1 changed files with 16 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
// Take a look at the license at the top of the repository in the LICENSE file.
|
// Take a look at the license at the top of the repository in the LICENSE file.
|
||||||
|
|
||||||
use glib::translate::*;
|
use glib::translate::*;
|
||||||
|
use std::fmt;
|
||||||
|
|
||||||
pub trait IsMiniObject:
|
pub trait IsMiniObject:
|
||||||
AsRef<Self::RefType> + FromGlibPtrFull<*mut Self::FfiType> + Send + Sync + 'static
|
AsRef<Self::RefType> + FromGlibPtrFull<*mut Self::FfiType> + Send + Sync + 'static
|
||||||
|
@ -553,6 +554,21 @@ impl MiniObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl fmt::Debug for MiniObject {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
self.as_ref().fmt(f)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl fmt::Debug for MiniObjectRef {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
f.debug_struct("MiniObject")
|
||||||
|
.field("ptr", unsafe { &self.as_ptr() })
|
||||||
|
.field("type", &self.type_())
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl MiniObjectRef {
|
impl MiniObjectRef {
|
||||||
pub fn type_(&self) -> glib::Type {
|
pub fn type_(&self) -> glib::Type {
|
||||||
unsafe { from_glib((*self.as_ptr()).type_) }
|
unsafe { from_glib((*self.as_ptr()).type_) }
|
||||||
|
|
Loading…
Reference in a new issue