pub struct CommandQueue<T> { /* private fields */ }Expand description
Неблокирующая bounded очередь команд
§Пример
use rill_core::queues::CommandQueue;
let queue = CommandQueue::<i32>::new("test", 16);
queue.send(42).unwrap();
assert_eq!(queue.try_recv(), Ok(42));Implementations§
Source§impl<T: Send + 'static> CommandQueue<T>
impl<T: Send + 'static> CommandQueue<T>
Sourcepub fn send(&self, value: T) -> Result<(), QueueError>
pub fn send(&self, value: T) -> Result<(), QueueError>
Отправить команду (из control thread)
Sourcepub fn try_recv(&self) -> Result<T, QueueError>
pub fn try_recv(&self) -> Result<T, QueueError>
Попытаться получить команду (из audio thread)
Trait Implementations§
Source§impl<T> Clone for CommandQueue<T>
impl<T> Clone for CommandQueue<T>
Source§impl TelemetryQueueExt for CommandQueue<Telemetry>
impl TelemetryQueueExt for CommandQueue<Telemetry>
fn send_parameter( &self, port: PortId, parameter: ParameterId, value: f32, ) -> Result<(), QueueError>
fn send_audio( &self, node_id: NodeId, channel: usize, data: Vec<f32>, ) -> Result<(), QueueError>
fn send_audio_with_sample_rate( &self, node_id: NodeId, channel: usize, data: Vec<f32>, sample_rate: f32, ) -> Result<(), QueueError>
fn send_peak(&self, port: PortId, value: f32) -> Result<(), QueueError>
fn send_peak_with_hold( &self, port: PortId, value: f32, hold_time_ms: u32, ) -> Result<(), QueueError>
fn send_event( &self, source: &str, kind: &str, data: Vec<f32>, ) -> Result<(), QueueError>
fn send_event_with_description( &self, source: &str, kind: &str, data: Vec<f32>, description: &str, ) -> Result<(), QueueError>
fn send_violation( &self, component: &str, expected_ns: u64, actual_ns: u64, value: Option<f32>, ) -> Result<(), QueueError>
Auto Trait Implementations§
impl<T> Freeze for CommandQueue<T>
impl<T> RefUnwindSafe for CommandQueue<T>
impl<T> Send for CommandQueue<T>where
T: Send,
impl<T> Sync for CommandQueue<T>where
T: Send,
impl<T> Unpin for CommandQueue<T>where
T: Unpin,
impl<T> UnsafeUnpin for CommandQueue<T>
impl<T> UnwindSafe for CommandQueue<T>
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