[−][src]Struct dasp_signal::bus::Output
An output node to which some signal S
is Output
ing its frames.
It may be more accurate to say that the Output
"pull"s frames from the signal.
Required Features
- When using
dasp_signal
, this item requires the bus feature to be enabled. - When using
dasp
, this item requires the signal-bus feature to be enabled.
Implementations
impl<S> Output<S> where
S: Signal,
[src]
S: Signal,
pub fn pending_frames(&self) -> usize
[src]
The number of frames that have been requested from the Signal
S
by some other Output
that have not yet been requested by this Output
.
This is useful when using an Output
to "monitor" some signal, allowing the user to drain
only frames that have already been requested by some other Output
.
Example
use dasp_signal::{self as signal, Signal}; use dasp_signal::bus::SignalBus; fn main() { let frames = [[0.1], [0.2], [0.3]]; let bus = signal::from_iter(frames.iter().cloned()).bus(); let signal = bus.send(); let mut monitor = bus.send(); assert_eq!(signal.take(3).collect::<Vec<_>>(), vec![[0.1], [0.2], [0.3]]); assert_eq!(monitor.pending_frames(), 3); assert_eq!(monitor.next(), [0.1]); assert_eq!(monitor.pending_frames(), 2); }
Required Features
- When using
dasp_signal
, this item requires the bus feature to be enabled. - When using
dasp
, this item requires the signal-bus feature to be enabled.
Trait Implementations
impl<S> Drop for Output<S> where
S: Signal,
[src]
S: Signal,
impl<S> Signal for Output<S> where
S: Signal,
[src]
S: Signal,
type Frame = S::Frame
The Frame
type returned by the Signal
.
fn next(&mut self) -> Self::Frame
[src]
fn is_exhausted(&self) -> bool
[src]
fn map<M, F>(self, map: M) -> Map<Self, M, F> where
Self: Sized,
M: FnMut(Self::Frame) -> F,
F: Frame,
[src]
Self: Sized,
M: FnMut(Self::Frame) -> F,
F: Frame,
fn zip_map<O, M, F>(self, other: O, map: M) -> ZipMap<Self, O, M, F> where
Self: Sized,
M: FnMut(Self::Frame, O::Frame) -> F,
O: Signal,
F: Frame,
[src]
Self: Sized,
M: FnMut(Self::Frame, O::Frame) -> F,
O: Signal,
F: Frame,
fn add_amp<S>(self, other: S) -> AddAmp<Self, S> where
Self: Sized,
S: Signal,
S::Frame: Frame<Sample = <<Self::Frame as Frame>::Sample as Sample>::Signed, NumChannels = <Self::Frame as Frame>::NumChannels>,
[src]
Self: Sized,
S: Signal,
S::Frame: Frame<Sample = <<Self::Frame as Frame>::Sample as Sample>::Signed, NumChannels = <Self::Frame as Frame>::NumChannels>,
fn mul_amp<S>(self, other: S) -> MulAmp<Self, S> where
Self: Sized,
S: Signal,
S::Frame: Frame<Sample = <<Self::Frame as Frame>::Sample as Sample>::Float, NumChannels = <Self::Frame as Frame>::NumChannels>,
[src]
Self: Sized,
S: Signal,
S::Frame: Frame<Sample = <<Self::Frame as Frame>::Sample as Sample>::Float, NumChannels = <Self::Frame as Frame>::NumChannels>,
fn offset_amp(
self,
offset: <<Self::Frame as Frame>::Sample as Sample>::Signed
) -> OffsetAmp<Self> where
Self: Sized,
[src]
self,
offset: <<Self::Frame as Frame>::Sample as Sample>::Signed
) -> OffsetAmp<Self> where
Self: Sized,
fn scale_amp(
self,
amp: <<Self::Frame as Frame>::Sample as Sample>::Float
) -> ScaleAmp<Self> where
Self: Sized,
[src]
self,
amp: <<Self::Frame as Frame>::Sample as Sample>::Float
) -> ScaleAmp<Self> where
Self: Sized,
fn offset_amp_per_channel<F>(self, amp_frame: F) -> OffsetAmpPerChannel<Self, F> where
Self: Sized,
F: Frame<Sample = <<Self::Frame as Frame>::Sample as Sample>::Signed, NumChannels = <Self::Frame as Frame>::NumChannels>,
[src]
Self: Sized,
F: Frame<Sample = <<Self::Frame as Frame>::Sample as Sample>::Signed, NumChannels = <Self::Frame as Frame>::NumChannels>,
fn scale_amp_per_channel<F>(self, amp_frame: F) -> ScaleAmpPerChannel<Self, F> where
Self: Sized,
F: Frame<Sample = <<Self::Frame as Frame>::Sample as Sample>::Float, NumChannels = <Self::Frame as Frame>::NumChannels>,
[src]
Self: Sized,
F: Frame<Sample = <<Self::Frame as Frame>::Sample as Sample>::Float, NumChannels = <Self::Frame as Frame>::NumChannels>,
fn mul_hz<M, I>(self, interpolator: I, mul_per_frame: M) -> MulHz<Self, M, I> where
Self: Sized,
M: Signal<Frame = f64>,
I: Interpolator,
[src]
Self: Sized,
M: Signal<Frame = f64>,
I: Interpolator,
fn from_hz_to_hz<I>(
self,
interpolator: I,
source_hz: f64,
target_hz: f64
) -> Converter<Self, I> where
Self: Sized,
I: Interpolator,
[src]
self,
interpolator: I,
source_hz: f64,
target_hz: f64
) -> Converter<Self, I> where
Self: Sized,
I: Interpolator,
fn scale_hz<I>(self, interpolator: I, multi: f64) -> Converter<Self, I> where
Self: Sized,
I: Interpolator,
[src]
Self: Sized,
I: Interpolator,
fn delay(self, n_frames: usize) -> Delay<Self> where
Self: Sized,
[src]
Self: Sized,
fn into_interleaved_samples(self) -> IntoInterleavedSamples<Self> where
Self: Sized,
[src]
Self: Sized,
fn clip_amp(
self,
thresh: <<Self::Frame as Frame>::Sample as Sample>::Signed
) -> ClipAmp<Self> where
Self: Sized,
[src]
self,
thresh: <<Self::Frame as Frame>::Sample as Sample>::Signed
) -> ClipAmp<Self> where
Self: Sized,
fn inspect<F>(self, inspect: F) -> Inspect<Self, F> where
Self: Sized,
F: FnMut(&Self::Frame),
[src]
Self: Sized,
F: FnMut(&Self::Frame),
fn fork<S>(self, ring_buffer: Bounded<S>) -> Fork<Self, S> where
Self: Sized,
S: SliceMut<Element = Self::Frame>,
[src]
Self: Sized,
S: SliceMut<Element = Self::Frame>,
fn take(self, n: usize) -> Take<Self> where
Self: Sized,
[src]
Self: Sized,
fn until_exhausted(self) -> UntilExhausted<Self> where
Self: Sized,
[src]
Self: Sized,
fn buffered<S>(self, ring_buffer: Bounded<S>) -> Buffered<Self, S> where
Self: Sized,
S: Slice<Element = Self::Frame> + SliceMut,
[src]
Self: Sized,
S: Slice<Element = Self::Frame> + SliceMut,
fn by_ref(&mut self) -> &mut Self where
Self: Sized,
[src]
Self: Sized,
Auto Trait Implementations
impl<S> !RefUnwindSafe for Output<S>
impl<S> !Send for Output<S>
impl<S> !Sync for Output<S>
impl<S> Unpin for Output<S>
impl<S> !UnwindSafe for Output<S>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<S, T> Duplex<S> for T where
T: FromSample<S> + ToSample<S>,
[src]
T: FromSample<S> + ToSample<S>,
impl<T> From<T> for T
[src]
impl<S> FromSample<S> for S
[src]
fn from_sample_(s: S) -> S
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SignalBus for T where
T: Signal,
[src]
T: Signal,
impl<T> SignalEnvelope for T where
T: Signal,
[src]
T: Signal,
fn detect_envelope<D>(
self,
detector: Detector<Self::Frame, D>
) -> DetectEnvelope<Self, D> where
Self: Sized,
D: Detect<Self::Frame>,
[src]
self,
detector: Detector<Self::Frame, D>
) -> DetectEnvelope<Self, D> where
Self: Sized,
D: Detect<Self::Frame>,
impl<T> SignalRms for T where
T: Signal,
[src]
T: Signal,
fn rms<S>(self, ring_buffer: Fixed<S>) -> Rms<Self, S> where
Self: Sized,
S: Slice<Element = <Self::Frame as Frame>::Float> + SliceMut,
[src]
Self: Sized,
S: Slice<Element = <Self::Frame as Frame>::Float> + SliceMut,
impl<T, U> ToSample<U> for T where
U: FromSample<T>,
[src]
U: FromSample<T>,
fn to_sample_(self) -> U
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,