pub struct StreamControl { /* private fields */ }Expand description
Thread-safe control handle for safety-critical actions.
This allows out-of-band control of the stream (arm/disarm/stop) from a different thread, e.g., for E-stop functionality.
Control actions take effect as soon as possible - the stream processes control messages at every opportunity (during waits, between retries, etc.).
Implementations§
Source§impl StreamControl
impl StreamControl
Sourcepub fn arm(&self) -> Result<()>
pub fn arm(&self) -> Result<()>
Arm the output (allow laser to fire).
When armed, content from the producer passes through unmodified and the hardware shutter is opened (best-effort).
Sourcepub fn disarm(&self) -> Result<()>
pub fn disarm(&self) -> Result<()>
Disarm the output (force laser off). Designed for E-stop use.
Immediately sets an atomic flag (works even if stream loop is blocked),
then sends a message to close the hardware shutter. All future points
are blanked in software. The stream stays alive outputting blanks -
use stop() to terminate entirely.
Latency: Points already in the device buffer will still play out.
target_queue_points bounds this latency.
Hardware shutter: Best-effort. LaserCube and Helios have actual hardware control; Ether Dream, IDN are no-ops (safety relies on software blanking).
Sourcepub fn stop(&self) -> Result<()>
pub fn stop(&self) -> Result<()>
Request the stream to stop.
Signals termination; run() returns RunExit::Stopped.
For clean shutdown with shutter close, prefer Stream::stop().
Sourcepub fn is_stop_requested(&self) -> bool
pub fn is_stop_requested(&self) -> bool
Check if a stop has been requested.
Trait Implementations§
Source§impl Clone for StreamControl
impl Clone for StreamControl
Source§fn clone(&self) -> StreamControl
fn clone(&self) -> StreamControl
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more