Toc: implement Debug trait

This commit is contained in:
François Laignel 2018-02-20 17:57:51 +01:00 committed by Sebastian Dröge
parent f92f0a99e8
commit 84e4546f72

View file

@ -7,6 +7,7 @@
// except according to those terms.
use std::ffi::CStr;
use std::fmt;
use std::mem;
use ffi;
@ -99,6 +100,16 @@ impl ToOwned for TocRef {
}
}
impl fmt::Debug for TocRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Toc")
.field("scope", &self.get_scope())
.field("tags", &self.get_tags())
.field("entries", &self.get_entries())
.finish()
}
}
unsafe impl Sync for TocRef {}
unsafe impl Send for TocRef {}
@ -237,6 +248,21 @@ impl ToOwned for TocEntryRef {
}
}
impl fmt::Debug for TocEntryRef {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("TocEntry")
.field("entry_type", &self.get_entry_type())
.field("uid", &self.get_uid())
.field("start_stop", &self.get_start_stop_times())
.field("tags", &self.get_tags())
.field("is_alternative", &self.is_alternative())
.field("is_sequence", &self.is_sequence())
.field("loop", &self.get_loop())
.field("sub_entries", &self.get_sub_entries())
.finish()
}
}
unsafe impl Sync for TocEntryRef {}
unsafe impl Send for TocEntryRef {}