[][src]Struct usb_device::test_class::TestClass

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

Test USB class for testing USB driver implementations. Supports various endpoint types and requests for testing USB peripheral drivers on actual hardware.

Methods

impl<B: UsbBus, '_> TestClass<'_, B>
[src]

pub fn new(alloc: &UsbBusAllocator<B>) -> TestClass<B>
[src]

Creates a new TestClass.

pub fn make_device<'a, 'b>(
    &'a self,
    usb_bus: &'b UsbBusAllocator<B>
) -> UsbDevice<'b, B>
[src]

Convenience method to create a UsbDevice that is configured correctly for TestClass.

pub fn poll(&mut self)
[src]

Must be called after polling the UsbDevice.

Trait Implementations

impl<B: UsbBus, '_> UsbClass<B> for TestClass<'_, B>
[src]

fn poll(&mut self)
[src]

Called whenever the UsbDevice is polled.

fn endpoint_setup(&mut self, addr: EndpointAddress)
[src]

Called when endpoint with address addr has received a SETUP packet. Implementing this shouldn't be necessary in most cases, but is provided for completeness' sake. Read more

Auto Trait Implementations

impl<'a, B> Send for TestClass<'a, B>

impl<'a, B> Sync for TestClass<'a, B>

Blanket Implementations

impl<T> From for T
[src]

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

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

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