Struct audio_streams::shm_streams::MockShmStream
source · pub struct MockShmStream {
num_channels: usize,
frame_rate: u32,
request_size: usize,
frame_size: usize,
request_notifier: Arc<(Mutex<bool>, Condvar)>,
}
Fields§
§num_channels: usize
§frame_rate: u32
§request_size: usize
§frame_size: usize
§request_notifier: Arc<(Mutex<bool>, Condvar)>
Implementations§
source§impl MockShmStream
impl MockShmStream
sourcepub fn new(
num_channels: usize,
frame_rate: u32,
format: SampleFormat,
buffer_size: usize
) -> Self
pub fn new( num_channels: usize, frame_rate: u32, format: SampleFormat, buffer_size: usize ) -> Self
Attempt to create a new MockShmStream with the given number of channels, frame_rate, format, and buffer_size.
sourcepub fn trigger_callback_with_timeout(&mut self, timeout: Duration) -> bool
pub fn trigger_callback_with_timeout(&mut self, timeout: Duration) -> bool
Call to request data from the stream, causing it to return from
wait_for_next_action_with_timeout
. Will block until
set_buffer_offset_and_frames
is called on the ServerRequest returned
from wait_for_next_action_with_timeout
, or until timeout
elapses.
Returns true if a response was successfully received.
fn notify_request(&mut self)
Trait Implementations§
source§impl BufferSet for MockShmStream
impl BufferSet for MockShmStream
source§impl Clone for MockShmStream
impl Clone for MockShmStream
source§fn clone(&self) -> MockShmStream
fn clone(&self) -> MockShmStream
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl ShmStream for MockShmStream
impl ShmStream for MockShmStream
source§fn frame_size(&self) -> usize
fn frame_size(&self) -> usize
Get the size of a frame of audio data for this stream.
source§fn num_channels(&self) -> usize
fn num_channels(&self) -> usize
Get the number of channels of audio data for this stream.
source§fn frame_rate(&self) -> u32
fn frame_rate(&self) -> u32
Get the frame rate of audio data for this stream.
source§fn wait_for_next_action_with_timeout(
&mut self,
timeout: Duration
) -> Result<Option<ServerRequest<'_>>, BoxError>
fn wait_for_next_action_with_timeout( &mut self, timeout: Duration ) -> Result<Option<ServerRequest<'_>>, BoxError>
Waits until the next server message indicating action is required. Read more
Auto Trait Implementations§
impl RefUnwindSafe for MockShmStream
impl Send for MockShmStream
impl Sync for MockShmStream
impl Unpin for MockShmStream
impl UnwindSafe for MockShmStream
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