pub struct FrameSession { /* private fields */ }Expand description
A frame-mode streaming session.
Owns a scheduler thread that reads frames from a channel and writes them to the DAC backend using the appropriate strategy (FIFO or frame-swap).
§Example
ⓘ
use laser_dac::{open_device, FrameSessionConfig, Frame, LaserPoint};
let device = open_device("my-device")?;
let config = FrameSessionConfig::new(30_000);
let (session, _info) = device.start_frame_session(config)?;
session.control().arm()?;
session.send_frame(Frame::new(vec![
LaserPoint::new(0.0, 0.0, 65535, 0, 0, 65535),
]));Implementations§
Source§impl FrameSession
impl FrameSession
Sourcepub fn control(&self) -> StreamControl
pub fn control(&self) -> StreamControl
Returns a control handle for arm/disarm/stop.
Sourcepub fn send_frame(&self, frame: Frame)
pub fn send_frame(&self, frame: Frame)
Submit a frame for display. Latest-wins: overwrites any unconsumed pending frame immediately, with no buffering or memory growth.
Sourcepub fn is_finished(&self) -> bool
pub fn is_finished(&self) -> bool
Returns true if the scheduler thread has finished.
Sourcepub fn metrics(&self) -> FrameSessionMetrics
pub fn metrics(&self) -> FrameSessionMetrics
Returns a metrics handle for observing scheduler liveness.
Trait Implementations§
Source§impl Drop for FrameSession
impl Drop for FrameSession
Auto Trait Implementations§
impl Freeze for FrameSession
impl !RefUnwindSafe for FrameSession
impl Send for FrameSession
impl Sync for FrameSession
impl Unpin for FrameSession
impl UnsafeUnpin for FrameSession
impl !UnwindSafe for FrameSession
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