pub fn new<F>(
        frame_size: usize,
        buffer: &'a mut [u8],
        drop: &'a mut F,
    ) -> Result<Self, PlaybackBufferError>
    where
        F: BufferDrop,
    {
        if buffer.len() % frame_size != 0 {
            return Err(PlaybackBufferError::InvalidLength);
        }

        Ok(PlaybackBuffer {
            buffer: AudioBuffer {
                buffer,
                offset: 0,
                frame_size,
                drop,
            },
        })
    }
/// Creates a new `PlaybackBuffer` that holds a reference to the backing memory specified in
/// `buffer`.
Creates a new `PlaybackBuffer` that holds a reference to the backing memory specified in
`buffer`.
Creates a new ` PlaybackBuffer ` that holds a reference to the backing memory specified in ` buffer ` .
pub fn new<F>(
        frame_size: usize,
        buffer: &'a mut [u8],
        drop: &'a mut F,
    ) -> Result<Self, PlaybackBufferError>
    where
        F: BufferDrop,
    {
        if buffer.len() % frame_size != 0 {
            return Err(PlaybackBufferError::InvalidLength);
        }
        Ok(PlaybackBuffer {
            buffer: AudioBuffer {
                buffer,
                offset: 0,
                frame_size,
                drop,
            },
        })
    }
pub fn new < F > ( frame_size : usize , buffer : & ' a mut [ u8 ] , drop : & ' a mut F , ) -> Result < Self , PlaybackBufferError > where F : BufferDrop , { if buffer . len ( ) % frame_size != 0 { return Err ( PlaybackBufferError :: InvalidLength ) ; } Ok ( PlaybackBuffer { buffer : AudioBuffer { buffer , offset : 0 , frame_size , drop , } , } ) }
Creates a new `PlaybackBuffer` that holds a reference to the backing memory specified in
`buffer`.
Creates a new ` PlaybackBuffer ` that holds a reference to the backing memory specified in ` buffer ` .
frame_size
usize
buffer
&'a mut [u8]
drop
&'a mut F
frame_size
usize
buffer
&'a mut [u8]
drop
&'a mut F