From ffaa6c3e017e98054f1840d187c10fcdb593b48f Mon Sep 17 00:00:00 2001 From: Eskil Q Date: Sat, 2 Jan 2021 08:43:15 +0100 Subject: add blanket impl for StreamingSignal --- mumd/src/audio.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mumd/src') 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; } +impl StreamingSignal for S + where + S: Signal + Unpin { + type Frame = S::Frame; + + fn poll_next(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll { + Poll::Ready(self.get_mut().next()) + } +} + trait StreamingSignalExt: StreamingSignal { fn next(&mut self) -> Next<'_, Self> { Next { -- cgit v1.2.1