pub struct VmoBuffer { /* private fields */ }
Expand description
A VMO-backed ring buffer that contains frames of audio.
Implementations§
Source§impl VmoBuffer
impl VmoBuffer
pub fn new( vmo: Vmo, num_frames: u64, format: Format, ) -> Result<Self, VmoBufferError>
Sourcepub fn data_size_bytes(&self) -> u64
pub fn data_size_bytes(&self) -> u64
Returns the size of the buffer in bytes.
This may be less than the size of the backing VMO.
Sourcepub fn write_to_frame(
&self,
frame: u64,
buf: &[u8],
) -> Result<(), VmoBufferError>
pub fn write_to_frame( &self, frame: u64, buf: &[u8], ) -> Result<(), VmoBufferError>
Writes all frames from buf
to the ring buffer at position frame
.
Sourcepub fn read_from_frame(
&self,
frame: u64,
buf: &mut [u8],
) -> Result<(), VmoBufferError>
pub fn read_from_frame( &self, frame: u64, buf: &mut [u8], ) -> Result<(), VmoBufferError>
Reads frames from the ring buffer into buf
starting at position frame
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for VmoBuffer
impl RefUnwindSafe for VmoBuffer
impl Send for VmoBuffer
impl Sync for VmoBuffer
impl Unpin for VmoBuffer
impl UnwindSafe for VmoBuffer
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