Embassy
embassy-usb

Crates

git

Versions

default

Flavors

Struct embassy_usb::msos::MsOsDescriptorWriter

source ·
pub struct MsOsDescriptorWriter<'d> { /* private fields */ }
Expand description

Writes a Microsoft OS 2.0 Descriptor set into a buffer.

Implementations§

source§

impl<'d> MsOsDescriptorWriter<'d>

source

pub fn is_empty(&self) -> bool

Returns true if the MS OS descriptor header has not yet been written

source

pub fn is_in_config_subset(&self) -> bool

Returns true if a configuration subset header has been started

source

pub fn is_in_function_subset(&self) -> bool

Returns true if a function subset header has been started and not yet ended

source

pub fn header(&mut self, windows_version: u32, vendor_code: u8)

Write the MS OS descriptor set header.

  • windows_version is an NTDDI version constant that describes a windows version. See the windows_version module.
  • vendor_code is the vendor request code used to read the MS OS descriptor set.
source

pub fn device_feature<T: DeviceLevelDescriptor>(&mut self, desc: T)

Add a device level feature descriptor.

Note that some feature descriptors may only be used at the device level in non-composite devices. Those features must be written before the first call to Self::configuration.

source

pub fn configuration(&mut self, config: u8)

Add a configuration subset.

source

pub fn function(&mut self, first_interface: InterfaceNumber)

Add a function subset.

source

pub fn function_feature<T: FunctionLevelDescriptor>(&mut self, desc: T)

Add a function level feature descriptor.

Note that some features may only be used at the function level. Those features must be written after a call to Self::function.

source

pub fn end_function(&mut self)

Ends the current function subset (if any)

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

§

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.