pub enum DeviceRequest {
StartVibration {
responder: DeviceStartVibrationResponder,
},
PlayVibration {
duration: i64,
responder: DevicePlayVibrationResponder,
},
PlayEffect {
effect: Effect,
strength: EffectStrength,
responder: DevicePlayEffectResponder,
},
PlayCompositeWaveform {
composite_waveform: Vec<CompositeEffect>,
responder: DevicePlayCompositeWaveformResponder,
},
StopVibration {
responder: DeviceStopVibrationResponder,
},
SetAmplitude {
amplitude: f32,
responder: DeviceSetAmplitudeResponder,
},
GetProperties {
responder: DeviceGetPropertiesResponder,
},
#[non_exhaustive] _UnknownMethod {
ordinal: u64,
control_handle: DeviceControlHandle,
method_type: MethodType,
},
}Variants§
StartVibration
Deprecated. Do not use. TODO(b/419629139): Remove once no longer used.
Fields
responder: DeviceStartVibrationResponderPlayVibration
Play a constant vibration for a period of time. Returns
ZX_ERR_BAD_STATE if a vibration is currently playing.
Function does not return until the vibration has completed.
PlayEffect
Play an effect. Returns ZX_ERR_BAD_STATE if a vibration is currently
playing.
Function does not return until the vibration has completed.
PlayCompositeWaveform
Play a composite waveform. Returns ZX_ERR_BAD_STATE if a vibration is
currently playing.
Function does not return until the vibration has completed.
StopVibration
Stops the vibration that is currently playing. Does nothing if there isn’t a vibration currently playing.
Function does not return until the vibration has stopped and its corresponding FIDL request to play the vibration has completed.
Fields
responder: DeviceStopVibrationResponderSetAmplitude
Alters the gain on vibrations played in the future.
GetProperties
Returns the haptics-related properties of the haptics device.
Fields
responder: DeviceGetPropertiesResponder#[non_exhaustive]_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
control_handle: DeviceControlHandlemethod_type: MethodTypeImplementations§
Source§impl DeviceRequest
impl DeviceRequest
pub fn into_start_vibration(self) -> Option<DeviceStartVibrationResponder>
pub fn into_play_vibration(self) -> Option<(i64, DevicePlayVibrationResponder)>
pub fn into_play_effect( self, ) -> Option<(Effect, EffectStrength, DevicePlayEffectResponder)>
pub fn into_play_composite_waveform( self, ) -> Option<(Vec<CompositeEffect>, DevicePlayCompositeWaveformResponder)>
pub fn into_stop_vibration(self) -> Option<DeviceStopVibrationResponder>
pub fn into_set_amplitude(self) -> Option<(f32, DeviceSetAmplitudeResponder)>
pub fn into_get_properties(self) -> Option<DeviceGetPropertiesResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL