Skip to main content

ControlIn

Struct ControlIn 

Source
pub struct ControlIn<'a, B: UsbBus> { /* private fields */ }
Expand description

Handle for a pending control IN transfer.

Passed to UsbClass::control_in. Call one of the accept_* methods or reject to respond; dropping without calling either passes the request to the next handler.

Implementations§

Source§

impl<'a, B: UsbBus> ControlIn<'a, B>

Source

pub fn request(&self) -> &Request

The SETUP packet that initiated this transfer.

Source

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

Accept with data written by a closure into the pipe buffer.

Source

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

Accept with a pre-built data slice.

Source

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

Accept with a 'static slice (avoids copy for large descriptors).

Source

pub fn reject(self) -> UsbResult<()>

Reject by stalling EP0.

Auto Trait Implementations§

§

impl<'a, B> !UnwindSafe for ControlIn<'a, B>

§

impl<'a, B> Forget for ControlIn<'a, B>

§

impl<'a, B> Freeze for ControlIn<'a, B>
where &'a B: Freeze,

§

impl<'a, B> Move for ControlIn<'a, B>

§

impl<'a, B> RefUnwindSafe for ControlIn<'a, B>

§

impl<'a, B> Send for ControlIn<'a, B>
where &'a B: Send,

§

impl<'a, B> Sync for ControlIn<'a, B>
where &'a B: Sync,

§

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

§

impl<'a, B> UnsafeUnpin for ControlIn<'a, B>

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<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> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.