[][src]Struct usb_device::class::ControlIn

pub struct ControlIn<'a, 'p, 'r, B: UsbBus> { /* fields omitted */ }

Handle for a control IN transfer. When implementing a class, use the methods of this object to response to the transfer with either data or an error (STALL condition). To ignore the request and pass it on to the next class, simply don't call any method.

Implementations

impl<'a, 'p, 'r, B: UsbBus> ControlIn<'a, 'p, 'r, B>[src]

pub fn request(&self) -> &Request[src]

Gets the request from the SETUP packet.

pub fn accept_with(self, data: &[u8]) -> Result<()>[src]

Accepts the transfer with the supplied buffer.

pub fn accept_with_static(self, data: &'static [u8]) -> Result<()>[src]

Accepts the transfer with the supplied static buffer. This method is useful when you have a large static descriptor to send as one packet.

pub fn accept(self, f: impl FnOnce(&mut [u8]) -> Result<usize>) -> Result<()>[src]

Accepts the transfer with a callback that can write to the internal buffer of the control pipe. Can be used to avoid an extra copy.

pub fn reject(self) -> Result<()>[src]

Rejects the transfer by stalling the pipe.

Auto Trait Implementations

impl<'a, 'p, 'r, B> Send for ControlIn<'a, 'p, 'r, B>

impl<'a, 'p, 'r, B> Sync for ControlIn<'a, 'p, 'r, B>

impl<'a, 'p, 'r, B> Unpin for ControlIn<'a, 'p, 'r, B> where
    'a: 'p, 

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.