Struct nusb::descriptors::Endpoint

source ·
pub struct Endpoint<'a>(/* private fields */);
Expand description

Information about a USB endpoint, with access to any associated descriptors.

Implementations§

source§

impl<'a> Endpoint<'a>

source

pub fn descriptors(&self) -> impl Iterator<Item = Descriptor<'_>>

Get the endpoint descriptor followed by all trailing descriptors up to the next endpoint or interface descriptor.

source

pub fn direction(&self) -> Direction

Get the endpoint’s direction.

source

pub fn transfer_type(&self) -> EndpointType

Get the endpoint’s transfer type.

source

pub fn max_packet_size(&self) -> usize

Get the maximum packet size in bytes.

source

pub fn packets_per_microframe(&self) -> u8

For isochronous endpoints at high speed, get the number of packets per microframe (1, 2, or 3).

source§

impl<'a> Endpoint<'a>

source

pub fn address(&self) -> u8

Get the bEndpointAddress descriptor field: Endpoint address.

source

pub fn attributes(&self) -> u8

Get the raw value of the bmAttributes descriptor field.

See `transfer_type`` for the transfer type field.

source

pub fn max_packet_size_raw(&self) -> u16

Get the raw value of the wMaxPacketSize descriptor field.

See max_macket_size and packets_per_microframe for the parsed subfields.

source

pub fn interval(&self) -> u8

Get the bInterval field: Polling interval in frames or microframes.

Trait Implementations§

source§

impl<'a> Debug for Endpoint<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Endpoint<'a>

§

impl<'a> RefUnwindSafe for Endpoint<'a>

§

impl<'a> Send for Endpoint<'a>

§

impl<'a> Sync for Endpoint<'a>

§

impl<'a> Unpin for Endpoint<'a>

§

impl<'a> UnwindSafe for Endpoint<'a>

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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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.