Skip to main content

PollResult

Enum PollResult 

Source
pub enum PollResult {
    None,
    Reset,
    Data {
        ep_out: u16,
        ep_in_complete: u16,
        ep_setup: u16,
    },
    Suspend,
    Resume,
}
Expand description

Events returned by UsbBus::poll.

Variants§

§

None

No events to report.

§

Reset

The USB bus was reset by the host.

§

Data

One or more endpoints have received or completed data.

Each field is a 16-bit mask where bit n corresponds to endpoint n.

Fields

§ep_out: u16

Endpoints that received an OUT packet.

§ep_in_complete: u16

Endpoints whose IN transfer completed.

§ep_setup: u16

Endpoints that received a SETUP packet (normally only EP0, bit 0).

§

Suspend

The host asserted USB suspend.

§

Resume

The host deasserted USB suspend (resume).

Implementations§

Source§

impl PollResult

Source

pub fn is_data(self) -> bool

true for PollResult::Data, i.e. when endpoint events are pending.

Auto Trait Implementations§

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.