From f2ea72224db80a08fd308da3ed8d3c118a347bc3 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 27 Oct 2022 16:20:21 +0200 Subject: [PATCH] feat(bindings): Add {TimelineItem,EventTimelineItem}::fmt_debug --- bindings/matrix-sdk-ffi/src/timeline.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bindings/matrix-sdk-ffi/src/timeline.rs b/bindings/matrix-sdk-ffi/src/timeline.rs index 17686f7d9..f52221245 100644 --- a/bindings/matrix-sdk-ffi/src/timeline.rs +++ b/bindings/matrix-sdk-ffi/src/timeline.rs @@ -153,6 +153,10 @@ impl TimelineItem { Arc::new(VirtualTimelineItem(vt)) }) } + + pub fn fmt_debug(&self) -> String { + format!("{:#?}", self.0) + } } pub struct EventTimelineItem(pub(crate) matrix_sdk::room::timeline::EventTimelineItem); @@ -196,6 +200,10 @@ impl EventTimelineItem { pub fn raw(&self) -> Option { self.0.raw().map(|r| r.json().get().to_owned()) } + + pub fn fmt_debug(&self) -> String { + format!("{:#?}", self.0) + } } #[derive(Clone, uniffi::Object)]