embassy-usb

Crates

git

Versions

default

Flavors

embassy_usb::msos

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

Source§

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

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.