Skip to main content

BackendKind

Enum BackendKind 

Source
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

Source

pub fn dac_type(&self) -> DacType

Returns the DAC type.

Source

pub fn caps(&self) -> &DacCapabilities

Returns the device capabilities.

Source

pub fn connect(&mut self) -> Result<()>

Connect to the device.

Source

pub fn disconnect(&mut self) -> Result<()>

Disconnect from the device.

Source

pub fn is_connected(&self) -> bool

Returns whether the device is connected.

Source

pub fn stop(&mut self) -> Result<()>

Stop output.

Source

pub fn set_shutter(&mut self, open: bool) -> Result<()>

Open/close the shutter.

Source

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()
Source

pub fn estimator(&self) -> Option<&dyn BufferEstimator>

The protocol-owned BufferEstimator for FIFO backends.

Frame-swap backends never queue points, so they return None.

Source

pub fn is_frame_swap(&self) -> bool

Returns true if this is a frame-swap backend.

Source

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.

Source

pub fn frame_capacity(&self) -> Option<usize>

Returns the frame capacity for frame-swap backends, or None for FIFO.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,