pub struct Packets<R: Read + Seek, S> { /* private fields */ }
Expand description
An iterator-like type that decodes packets into a user-provided buffer.
Implementations§
Source§impl<R: Read + Seek, S: Sample> Packets<R, S>
impl<R: Read + Seek, S: Sample> Packets<R, S>
Sourcepub fn stream_info(&self) -> &StreamInfo
pub fn stream_info(&self) -> &StreamInfo
Returns a StreamInfo
describing the ALAC stream in this file.
Sourcepub fn next_into<'a>(
&mut self,
out: &'a mut [S],
) -> Result<Option<&'a [S]>, ReadError>
pub fn next_into<'a>( &mut self, out: &'a mut [S], ) -> Result<Option<&'a [S]>, ReadError>
Reads the next packet and decodes it into out
.
Channels are interleaved, e.g. for a stereo packet out
would contains samples in the
order [left, right, left, right, ..]
.
Panics if out
is shorter than StreamInfo::max_samples_per_packet
.
Auto Trait Implementations§
impl<R, S> Freeze for Packets<R, S>where
R: Freeze,
impl<R, S> RefUnwindSafe for Packets<R, S>where
S: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, S> Send for Packets<R, S>
impl<R, S> Sync for Packets<R, S>
impl<R, S> Unpin for Packets<R, S>
impl<R, S> UnwindSafe for Packets<R, S>where
S: UnwindSafe,
R: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more