mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-29 13:01:05 +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)]
|
#[derive(Debug)]
|
||||||
pub struct PromiseFuture(Promise, futures_channel::oneshot::Receiver<()>);
|
pub struct PromiseFuture(Promise, futures_channel::oneshot::Receiver<()>);
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct PromiseReply(Promise);
|
pub struct PromiseReply(Promise);
|
||||||
|
|
||||||
impl std::future::Future for PromiseFuture {
|
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)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
Loading…
Reference in a new issue