pub trait DeviceControl {
    // Required methods
    fn open(&mut self) -> ControlResult<()>;
    fn close(&mut self) -> ControlResult<()>;
    fn is_opened(&self) -> bool;
    fn read(&mut self, address: u64, buf: &mut [u8]) -> ControlResult<()>;
    fn write(&mut self, address: u64, data: &[u8]) -> ControlResult<()>;
    fn genapi(&mut self) -> ControlResult<String>;
    fn enable_streaming(&mut self) -> ControlResult<()>;
    fn disable_streaming(&mut self) -> ControlResult<()>;
}
Expand description

This trait provides operations on the device’s memory.

Required Methods§

source

fn open(&mut self) -> ControlResult<()>

Opens the handle.

source

fn close(&mut self) -> ControlResult<()>

Closes the handle.

source

fn is_opened(&self) -> bool

Returns true if device is already opened.

source

fn read(&mut self, address: u64, buf: &mut [u8]) -> ControlResult<()>

Reads data from the device’s memory.

Reads length is same as buf.len().

source

fn write(&mut self, address: u64, data: &[u8]) -> ControlResult<()>

Writes data to the device’s memory.

source

fn genapi(&mut self) -> ControlResult<String>

Returns GenICam xml string.

source

fn enable_streaming(&mut self) -> ControlResult<()>

Enables streaming.

source

fn disable_streaming(&mut self) -> ControlResult<()>

Disables streaming.

Trait Implementations§

source§

impl From<ControlHandle> for Box<dyn DeviceControl>

source§

fn from(ctrl: ControlHandle) -> Self

Converts to this type from the input type.
source§

impl From<SharedControlHandle> for Box<dyn DeviceControl>

source§

fn from(ctrl: SharedControlHandle) -> Self

Converts to this type from the input type.

Implementations on Foreign Types§

source§

impl<T: DeviceControl + ?Sized> DeviceControl for Box<T>

source§

fn open(&mut self) -> ControlResult<()>

source§

fn close(&mut self) -> ControlResult<()>

source§

fn is_opened(&self) -> bool

source§

fn read(&mut self, address: u64, buf: &mut [u8]) -> ControlResult<()>

source§

fn write(&mut self, address: u64, data: &[u8]) -> ControlResult<()>

source§

fn genapi(&mut self) -> ControlResult<String>

source§

fn enable_streaming(&mut self) -> ControlResult<()>

source§

fn disable_streaming(&mut self) -> ControlResult<()>

source§

impl<'a, T: 'a + DeviceControl + ?Sized> DeviceControl for &'a mut T

source§

fn open(&mut self) -> ControlResult<()>

source§

fn close(&mut self) -> ControlResult<()>

source§

fn is_opened(&self) -> bool

source§

fn read(&mut self, address: u64, buf: &mut [u8]) -> ControlResult<()>

source§

fn write(&mut self, address: u64, data: &[u8]) -> ControlResult<()>

source§

fn genapi(&mut self) -> ControlResult<String>

source§

fn enable_streaming(&mut self) -> ControlResult<()>

source§

fn disable_streaming(&mut self) -> ControlResult<()>

Implementors§