Enum buttplug::client::device::ScalarValueCommand
source · pub enum ScalarValueCommand {
ScalarValue(f64),
ScalarValueVec(Vec<f64>),
ScalarValueMap(HashMap<u32, f64>),
}Expand description
Convenience enum for forming [VibrateCmd] commands.
Allows users to easily specify speeds across different vibration features in a device. Units are in absolute speed values (0.0-1.0).
Variants§
ScalarValue(f64)
Sets all vibration features of a device to the same speed.
ScalarValueVec(Vec<f64>)
Sets vibration features to speed based on the index of the speed in the
vec (i.e. motor 0 is set to SpeedVec[0], motor 1 is set to
SpeedVec[1], etc…)
ScalarValueMap(HashMap<u32, f64>)
Sets vibration features indicated by index to requested speed. For instance, if the map has an entry of (1, 0.5), it will set motor 1 to a speed of 0.5.
Auto Trait Implementations§
impl Freeze for ScalarValueCommand
impl RefUnwindSafe for ScalarValueCommand
impl Send for ScalarValueCommand
impl Sync for ScalarValueCommand
impl Unpin for ScalarValueCommand
impl UnwindSafe for ScalarValueCommand
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