Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 03e3314

Browse files
committed
Implement Debug for SignalInvocationHint and SignalClassHandlerToken
1 parent b0f10fd commit 03e3314

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/subclass/types.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use ffi;
88
use gobject_ffi;
99

10+
use std::fmt;
1011
use std::marker;
1112
use std::mem;
1213
use std::ptr;
@@ -535,6 +536,15 @@ impl SignalInvocationHint {
535536
}
536537
}
537538

539+
impl fmt::Debug for SignalInvocationHint {
540+
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
541+
f.debug_struct("SignalInvocationHint")
542+
.field("detail", &self.detail())
543+
.field("run_type", &self.run_type())
544+
.finish()
545+
}
546+
}
547+
538548
pub(crate) unsafe fn add_signal_with_accumulator<F>(
539549
type_: ffi::GType,
540550
name: &str,
@@ -582,6 +592,14 @@ pub(crate) unsafe fn add_signal_with_accumulator<F>(
582592

583593
pub struct SignalClassHandlerToken(*mut gobject_ffi::GTypeInstance);
584594

595+
impl fmt::Debug for SignalClassHandlerToken {
596+
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
597+
f.debug_tuple("SignalClassHandlerToken")
598+
.field(&unsafe { ::Object::from_glib_borrow(self.0 as *mut gobject_ffi::GObject) })
599+
.finish()
600+
}
601+
}
602+
585603
pub(crate) unsafe fn add_signal_with_class_handler<F>(
586604
type_: ffi::GType,
587605
name: &str,

0 commit comments

Comments
 (0)