Struct nusb::descriptors::InterfaceAltSetting

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

Information about a USB interface alternate setting, with access to associated endpoints and other descriptors.

An interface descriptor represents a single alternate setting of an interface. Multiple interface descriptors with the same interface_number but different alternate_setting values represent different alternate settings.

Implementations§

source§

impl<'a> InterfaceAltSetting<'a>

source

pub fn descriptors(&self) -> Descriptors<'_>

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

source

pub fn endpoints(&self) -> impl Iterator<Item = Endpoint<'_>>

Get the endpoints of this interface.

source§

impl<'a> InterfaceAltSetting<'a>

source

pub fn interface_number(&self) -> u8

bInterfaceNumber descriptor field: Identifier for the interface.

Pass this to Device::claim_interface to work with the interface.

source

pub fn alternate_setting(&self) -> u8

bAlternateSetting descriptor field: Identifier for this alternate setting.

Pass this to Interface::set_alt_setting to use this alternate setting.

source

pub fn num_endpoints(&self) -> u8

bNumEndpoints descriptor field: Number of endpoints in this alternate setting.

source

pub fn class(&self) -> u8

bInterfaceClass descriptor field: Standard interface class.

source

pub fn subclass(&self) -> u8

bInterfaceSubClass descriptor field: Standard interface subclass.

source

pub fn protocol(&self) -> u8

bInterfaceProtocol descriptor field: Standard interface protocol.

source§

impl<'a> InterfaceAltSetting<'a>

source

pub fn string_index(&self) -> Option<u8>

Index of the string descriptor describing this interface or alternate setting.

Trait Implementations§

source§

impl<'a> Clone for InterfaceAltSetting<'a>

source§

fn clone(&self) -> InterfaceAltSetting<'a>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a> Debug for InterfaceAltSetting<'a>

source§

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

Formats the value using the given formatter. Read more

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.