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

Commit

Permalink
Implement Debug for SignalInvocationHint and SignalClassHandlerToken
Browse files Browse the repository at this point in the history
  • Loading branch information
sdroege committed Feb 7, 2019
1 parent b0f10fd commit 03e3314
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/subclass/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use ffi;
use gobject_ffi;

use std::fmt;
use std::marker;
use std::mem;
use std::ptr;
Expand Down Expand Up @@ -535,6 +536,15 @@ impl SignalInvocationHint {
}
}

impl fmt::Debug for SignalInvocationHint {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
f.debug_struct("SignalInvocationHint")
.field("detail", &self.detail())
.field("run_type", &self.run_type())
.finish()
}
}

pub(crate) unsafe fn add_signal_with_accumulator<F>(
type_: ffi::GType,
name: &str,
Expand Down Expand Up @@ -582,6 +592,14 @@ pub(crate) unsafe fn add_signal_with_accumulator<F>(

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

impl fmt::Debug for SignalClassHandlerToken {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
f.debug_tuple("SignalClassHandlerToken")
.field(&unsafe { ::Object::from_glib_borrow(self.0 as *mut gobject_ffi::GObject) })
.finish()
}
}

pub(crate) unsafe fn add_signal_with_class_handler<F>(
type_: ffi::GType,
name: &str,
Expand Down

0 comments on commit 03e3314

Please sign in to comment.