mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-05 09:10:22 +00:00
gstreamer: manually implement Debug on PromiseReply
The default implementation was not very useful: PromiseReply( Promise { inner: Shared { inner: 0x00007ff108001090, }, }, )
This commit is contained in:
parent
a341b4972f
commit
e229288ecd
1 changed files with 12 additions and 1 deletions
|
@ -150,7 +150,6 @@ unsafe impl Sync for Promise {}
|
|||
#[derive(Debug)]
|
||||
pub struct PromiseFuture(Promise, futures_channel::oneshot::Receiver<()>);
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct PromiseReply(Promise);
|
||||
|
||||
impl std::future::Future for PromiseFuture {
|
||||
|
@ -196,6 +195,18 @@ impl Deref for PromiseReply {
|
|||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for PromiseReply {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
let mut debug = f.debug_tuple("PromiseReply");
|
||||
|
||||
match self.0.get_reply() {
|
||||
Some(reply) => debug.field(reply),
|
||||
None => debug.field(&"<no reply>"),
|
||||
}
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
|
Loading…
Reference in a new issue