aboutsummaryrefslogtreecommitdiffstats
path: root/mumd/src/audio.rs
diff options
context:
space:
mode:
authorEskil Q <eskilq@kth.se>2021-01-02 08:43:15 +0100
committerEskil Q <eskilq@kth.se>2021-01-02 08:43:15 +0100
commitffaa6c3e017e98054f1840d187c10fcdb593b48f (patch)
tree5fc4adf05d005a7ad15f44f9dcb9e80571b42fa0 /mumd/src/audio.rs
parent5cdac93a475b4402680ac8d274677f4ba29b1e25 (diff)
downloadmum-ffaa6c3e017e98054f1840d187c10fcdb593b48f.tar.gz
add blanket impl for StreamingSignal
Diffstat (limited to 'mumd/src/audio.rs')
-rw-r--r--mumd/src/audio.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/mumd/src/audio.rs b/mumd/src/audio.rs
index 324b615..cd6141a 100644
--- a/mumd/src/audio.rs
+++ b/mumd/src/audio.rs
@@ -433,6 +433,16 @@ trait StreamingSignal {
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Frame>;
}
+impl<S> StreamingSignal for S
+ where
+ S: Signal + Unpin {
+ type Frame = S::Frame;
+
+ fn poll_next(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Self::Frame> {
+ Poll::Ready(self.get_mut().next())
+ }
+}
+
trait StreamingSignalExt: StreamingSignal {
fn next(&mut self) -> Next<'_, Self> {
Next {