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>
impl<'d> MsOsDescriptorWriter<'d>
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Returns true
if the MS OS descriptor header has not yet been written
Sourcepub fn is_in_config_subset(&self) -> bool
pub fn is_in_config_subset(&self) -> bool
Returns true
if a configuration subset header has been started
Sourcepub fn is_in_function_subset(&self) -> bool
pub fn is_in_function_subset(&self) -> bool
Returns true
if a function subset header has been started and not yet ended
Sourcepub fn header(&mut self, windows_version: u32, vendor_code: u8)
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 thewindows_version
module.vendor_code
is the vendor request code used to read the MS OS descriptor set.
Sourcepub fn device_feature<T: DeviceLevelDescriptor>(&mut self, desc: T)
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
.
Sourcepub fn configuration(&mut self, config: u8)
pub fn configuration(&mut self, config: u8)
Add a configuration subset.
Sourcepub fn function(&mut self, first_interface: InterfaceNumber)
pub fn function(&mut self, first_interface: InterfaceNumber)
Add a function subset.
Sourcepub fn function_feature<T: FunctionLevelDescriptor>(&mut self, desc: T)
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
.
Sourcepub fn end_function(&mut self)
pub fn end_function(&mut self)
Ends the current function subset (if any)