pub struct DeviceProxy { /* private fields */ }Implementations§
Source§impl DeviceProxy
impl DeviceProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.hardware.haptics/Device.
Sourcepub fn take_event_stream(&self) -> DeviceEventStream
pub fn take_event_stream(&self) -> DeviceEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn start_vibration(
&self,
) -> QueryResponseFut<DeviceStartVibrationResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn start_vibration( &self, ) -> QueryResponseFut<DeviceStartVibrationResult, DefaultFuchsiaResourceDialect> ⓘ
Deprecated. Do not use. TODO(b/419629139): Remove once no longer used.
Sourcepub fn play_vibration(
&self,
duration: i64,
) -> QueryResponseFut<DevicePlayVibrationResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn play_vibration( &self, duration: i64, ) -> QueryResponseFut<DevicePlayVibrationResult, DefaultFuchsiaResourceDialect> ⓘ
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.
Sourcepub fn play_effect(
&self,
effect: Effect,
strength: EffectStrength,
) -> QueryResponseFut<DevicePlayEffectResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn play_effect( &self, effect: Effect, strength: EffectStrength, ) -> QueryResponseFut<DevicePlayEffectResult, DefaultFuchsiaResourceDialect> ⓘ
Play an effect. Returns ZX_ERR_BAD_STATE if a vibration is currently
playing.
Function does not return until the vibration has completed.
Sourcepub fn play_composite_waveform(
&self,
composite_waveform: &[CompositeEffect],
) -> QueryResponseFut<DevicePlayCompositeWaveformResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn play_composite_waveform( &self, composite_waveform: &[CompositeEffect], ) -> QueryResponseFut<DevicePlayCompositeWaveformResult, DefaultFuchsiaResourceDialect> ⓘ
Play a composite waveform. Returns ZX_ERR_BAD_STATE if a vibration is
currently playing.
Function does not return until the vibration has completed.
Sourcepub fn stop_vibration(
&self,
) -> QueryResponseFut<DeviceStopVibrationResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn stop_vibration( &self, ) -> QueryResponseFut<DeviceStopVibrationResult, DefaultFuchsiaResourceDialect> ⓘ
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.
Sourcepub fn set_amplitude(
&self,
amplitude: f32,
) -> QueryResponseFut<DeviceSetAmplitudeResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn set_amplitude( &self, amplitude: f32, ) -> QueryResponseFut<DeviceSetAmplitudeResult, DefaultFuchsiaResourceDialect> ⓘ
Alters the gain on vibrations played in the future.
Sourcepub fn get_properties(
&self,
) -> QueryResponseFut<DeviceGetPropertiesResult, DefaultFuchsiaResourceDialect> ⓘ
pub fn get_properties( &self, ) -> QueryResponseFut<DeviceGetPropertiesResult, DefaultFuchsiaResourceDialect> ⓘ
Returns the haptics-related properties of the haptics device.
Trait Implementations§
Source§impl Clone for DeviceProxy
impl Clone for DeviceProxy
Source§fn clone(&self) -> DeviceProxy
fn clone(&self) -> DeviceProxy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeviceProxy
impl Debug for DeviceProxy
Source§impl DeviceProxyInterface for DeviceProxy
impl DeviceProxyInterface for DeviceProxy
type StartVibrationResponseFut = QueryResponseFut<Result<(), i32>>
type PlayVibrationResponseFut = QueryResponseFut<Result<(), i32>>
type PlayEffectResponseFut = QueryResponseFut<Result<(), i32>>
type PlayCompositeWaveformResponseFut = QueryResponseFut<Result<(), i32>>
type StopVibrationResponseFut = QueryResponseFut<Result<(), i32>>
type SetAmplitudeResponseFut = QueryResponseFut<Result<(), i32>>
type GetPropertiesResponseFut = QueryResponseFut<Result<(f32, f32, Vec<SupportedEffect>, Vec<SupportedCompositeEffectWaveform>, u64, i64), i32>>
fn start_vibration(&self) -> Self::StartVibrationResponseFut
fn play_vibration(&self, duration: i64) -> Self::PlayVibrationResponseFut
fn play_effect( &self, effect: Effect, strength: EffectStrength, ) -> Self::PlayEffectResponseFut
fn play_composite_waveform( &self, composite_waveform: &[CompositeEffect], ) -> Self::PlayCompositeWaveformResponseFut
fn stop_vibration(&self) -> Self::StopVibrationResponseFut
fn set_amplitude(&self, amplitude: f32) -> Self::SetAmplitudeResponseFut
fn get_properties(&self) -> Self::GetPropertiesResponseFut
Source§impl Proxy for DeviceProxy
impl Proxy for DeviceProxy
Source§type Protocol = DeviceMarker
type Protocol = DeviceMarker
Proxy controls.