Trait vcs_classic_hid::Device[][src]

pub trait Device {
    type Error;
    fn set_blocking(&mut self, blocking: bool) -> Result<(), Self::Error>;
fn read(&mut self, out: &mut [u8]) -> Result<usize, Self::Error>;
fn write<T>(&mut self, data: T) -> Result<usize, Self::Error>
    where
        T: AsRef<[u8]>
; fn reset_leds(&mut self) -> Result<(), Self::Error> { ... } }

Generic interface for human interaction devices.

Associated Types

type Error[src]

The type used for errors

Loading content...

Required methods

fn set_blocking(&mut self, blocking: bool) -> Result<(), Self::Error>[src]

Set or unset blocking mode

fn read(&mut self, out: &mut [u8]) -> Result<usize, Self::Error>[src]

Read a report into the given array, returns the number of bytes read.

fn write<T>(&mut self, data: T) -> Result<usize, Self::Error> where
    T: AsRef<[u8]>, 
[src]

Write a report to the device, returns the number of bytes effectively written.

Safety: the operation is not memory unsafe, but can still cause catastrophic problems to the device depending on the data passed.

Loading content...

Provided methods

fn reset_leds(&mut self) -> Result<(), Self::Error>[src]

Write a report which disables LED manipulation in the VCS classic controller.

Loading content...

Implementations on Foreign Types

impl<D> Device for &mut D where
    D: Device
[src]

type Error = D::Error

impl Device for HidDevice[src]

type Error = HidError

Loading content...

Implementors

Loading content...