pub enum BackendKind {
Fifo(Box<dyn FifoBackend>),
FrameSwap(Box<dyn FrameSwapBackend>),
}Expand description
Type-erased backend wrapper for use in the stream scheduler.
Wraps either a FifoBackend or a FrameSwapBackend, providing
delegation for common DacBackend methods and a unified write path.
Variants§
Fifo(Box<dyn FifoBackend>)
A FIFO/queue-based backend.
FrameSwap(Box<dyn FrameSwapBackend>)
A double-buffered frame-swap backend.
Implementations§
Source§impl BackendKind
impl BackendKind
Sourcepub fn caps(&self) -> &DacCapabilities
pub fn caps(&self) -> &DacCapabilities
Returns the device capabilities.
Sourcepub fn disconnect(&mut self) -> Result<()>
pub fn disconnect(&mut self) -> Result<()>
Disconnect from the device.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Returns whether the device is connected.
Sourcepub fn set_shutter(&mut self, open: bool) -> Result<()>
pub fn set_shutter(&mut self, open: bool) -> Result<()>
Open/close the shutter.
Sourcepub fn try_write(
&mut self,
pps: u32,
points: &[LaserPoint],
) -> Result<WriteOutcome>
pub fn try_write( &mut self, pps: u32, points: &[LaserPoint], ) -> Result<WriteOutcome>
Write points to the backend (dispatches to the appropriate method).
- For FIFO backends: calls
try_write_points() - For frame-swap backends: calls
write_frame()
Sourcepub fn estimator(&self) -> Option<&dyn BufferEstimator>
pub fn estimator(&self) -> Option<&dyn BufferEstimator>
The protocol-owned BufferEstimator for FIFO backends.
Frame-swap backends never queue points, so they return None.
Sourcepub fn is_frame_swap(&self) -> bool
pub fn is_frame_swap(&self) -> bool
Returns true if this is a frame-swap backend.
Sourcepub fn is_ready_for_frame(&mut self) -> bool
pub fn is_ready_for_frame(&mut self) -> bool
Returns true if the device is ready to accept a new frame.
For FIFO backends, always returns true (they handle backpressure via try_write).
For frame-swap backends, queries the device readiness.
Sourcepub fn frame_capacity(&self) -> Option<usize>
pub fn frame_capacity(&self) -> Option<usize>
Returns the frame capacity for frame-swap backends, or None for FIFO.