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

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.

Implementations

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 make_device_builder<'a, 'b>(
    &'a self,
    usb_bus: &'b UsbBusAllocator<B>
) -> UsbDeviceBuilder<'b, B>
[src]

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

The methods sets

  • manufacturer
  • product
  • serial number
  • max_packet_size_0

on the returned builder. If you change the manufacturer, product, or serial number fields, the test host may misbehave.

pub fn poll(&mut self)[src]

Must be called after polling the UsbDevice.

Trait Implementations

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

Auto Trait Implementations

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

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

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

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.