pub enum DeviceRequest {
GetConfiguration {
responder: DeviceGetConfigurationResponder,
},
SetConfiguration {
device_desc: DeviceDescriptor,
config_descriptors: Vec<Vec<FunctionDescriptor>>,
responder: DeviceSetConfigurationResponder,
},
ClearFunctions {
responder: DeviceClearFunctionsResponder,
},
SetStateChangeListener {
listener: ClientEnd<EventsMarker>,
control_handle: DeviceControlHandle,
},
#[non_exhaustive] _UnknownMethod {
ordinal: u64,
control_handle: DeviceControlHandle,
method_type: MethodType,
},
}Variants§
GetConfiguration
Retrieves the current device descriptor and active configuration descriptors.
Returns the active USB device descriptor and all associated configuration descriptors registered with the peripheral device manager.
- error:
ZX_ERR_BAD_STATE: The peripheral device has not been configured.
Fields
§
responder: DeviceGetConfigurationResponderSetConfiguration
Sets the device’s descriptors, adds the functions and creates the child devices for the configuration’s interfaces. At least one function descriptor must be provided.
Fields
§
device_desc: DeviceDescriptor§
config_descriptors: Vec<Vec<FunctionDescriptor>>§
responder: DeviceSetConfigurationResponderClearFunctions
Tells the device to remove the child devices for the configuration’s interfaces
and reset the list of functions to empty.
The caller should wait for the FunctionsCleared event.
Fields
§
responder: DeviceClearFunctionsResponderSetStateChangeListener
Adds a state change listener that is invoked when a state change completes.
#[non_exhaustive]_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§
control_handle: DeviceControlHandle§
method_type: MethodTypeImplementations§
Source§impl DeviceRequest
impl DeviceRequest
pub fn into_get_configuration(self) -> Option<DeviceGetConfigurationResponder>
pub fn into_set_configuration( self, ) -> Option<(DeviceDescriptor, Vec<Vec<FunctionDescriptor>>, DeviceSetConfigurationResponder)>
pub fn into_clear_functions(self) -> Option<DeviceClearFunctionsResponder>
pub fn into_set_state_change_listener( self, ) -> Option<(ClientEnd<EventsMarker>, DeviceControlHandle)>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for DeviceRequest
impl !UnwindSafe for DeviceRequest
impl Freeze for DeviceRequest
impl Send for DeviceRequest
impl Sync for DeviceRequest
impl Unpin for DeviceRequest
impl UnsafeUnpin for DeviceRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more