Implement Source on Box<Source>

This commit is contained in:
Pierre Krieger 2017-05-01 13:16:06 +02:00
parent f0fed7ccb9
commit 4e58aeb5c7

View file

@ -227,3 +227,69 @@ pub trait Source: Iterator
SamplesConverter::new(self)
}
}
impl<S> Source for Box<Source<Item = S>> where S: Sample {
#[inline]
fn current_frame_len(&self) -> Option<usize> {
(**self).current_frame_len()
}
#[inline]
fn channels(&self) -> u16 {
(**self).channels()
}
#[inline]
fn samples_rate(&self) -> u32 {
(**self).samples_rate()
}
#[inline]
fn total_duration(&self) -> Option<Duration> {
(**self).total_duration()
}
}
impl<S> Source for Box<Source<Item = S> + Send> where S: Sample {
#[inline]
fn current_frame_len(&self) -> Option<usize> {
(**self).current_frame_len()
}
#[inline]
fn channels(&self) -> u16 {
(**self).channels()
}
#[inline]
fn samples_rate(&self) -> u32 {
(**self).samples_rate()
}
#[inline]
fn total_duration(&self) -> Option<Duration> {
(**self).total_duration()
}
}
impl<S> Source for Box<Source<Item = S> + Send + Sync> where S: Sample {
#[inline]
fn current_frame_len(&self) -> Option<usize> {
(**self).current_frame_len()
}
#[inline]
fn channels(&self) -> u16 {
(**self).channels()
}
#[inline]
fn samples_rate(&self) -> u32 {
(**self).samples_rate()
}
#[inline]
fn total_duration(&self) -> Option<Duration> {
(**self).total_duration()
}
}