Buttplug sex toy control library

chore: remove unused ButtplugCurrentSpecDeviceMessageType enum

-121
-3
buttplug/src/client/device.rs
··· 21 21 messages::{ 22 22 ActuatorType, 23 23 ButtplugCurrentSpecClientMessage, 24 - ButtplugCurrentSpecDeviceMessageType, 25 24 ButtplugCurrentSpecServerMessage, 26 25 ButtplugDeviceMessageType, 27 26 ButtplugMessage, ··· 140 139 /// motor 1 to move to position 0.5 over the course of 500ms. 141 140 LinearMap(HashMap<u32, (u32, f64)>), 142 141 } 143 - 144 - pub type ButtplugClientDeviceMessageType = ButtplugCurrentSpecDeviceMessageType; 145 142 146 143 #[derive(Getters, CopyGetters)] 147 144 /// Client-usable representation of device connected to the corresponding
-1
buttplug/src/client/mod.rs
··· 37 37 pub use device::{ 38 38 ButtplugClientDevice, 39 39 ButtplugClientDeviceEvent, 40 - ButtplugClientDeviceMessageType, 41 40 LinearCommand, 42 41 RotateCommand, 43 42 ScalarCommand,
-117
buttplug/src/core/messages/mod.rs
··· 241 241 self.to_string().cmp(&other.to_string()) 242 242 } 243 243 } 244 - /// Used in [MessageAttributes][crate::core::messages::DeviceMessageAttributes] for denoting message 245 - /// capabilties. Only contains message that are valid in the current version of the spec. 246 - #[derive(Copy, Debug, Clone, PartialEq, Eq, Hash, Display, Serialize, Deserialize)] 247 - pub enum ButtplugCurrentSpecDeviceMessageType { 248 - // Generic commands 249 - // 250 - // If you add to or change this, make sure to update the 251 - // ServerMessage.MessageAttributeType enum in buttplug-rs-ffi repo, including 252 - // the try_from trait, otherwise conversion will always fail and we won't see 253 - // the new messages in the FFI layers. 254 - VibrateCmd, 255 - LinearCmd, 256 - RotateCmd, 257 - StopDeviceCmd, 258 - RawWriteCmd, 259 - RawReadCmd, 260 - RawSubscribeCmd, 261 - RawUnsubscribeCmd, 262 - BatteryLevelCmd, 263 - RSSILevelCmd, 264 - ScalarCmd, 265 - SensorReadCmd, 266 - SensorSubscribeCmd, 267 - SensorUnsubscribeCmd, 268 - } 269 - 270 - // Ordering for ButtplugCurrentDeviceMessageType should be lexicographic, for 271 - // serialization reasons. 272 - impl PartialOrd for ButtplugCurrentSpecDeviceMessageType { 273 - fn partial_cmp(&self, other: &ButtplugCurrentSpecDeviceMessageType) -> Option<Ordering> { 274 - Some(self.cmp(other)) 275 - } 276 - } 277 - 278 - impl Ord for ButtplugCurrentSpecDeviceMessageType { 279 - fn cmp(&self, other: &ButtplugCurrentSpecDeviceMessageType) -> Ordering { 280 - self.to_string().cmp(&other.to_string()) 281 - } 282 - } 283 - 284 - impl TryFrom<ButtplugDeviceMessageType> for ButtplugCurrentSpecDeviceMessageType { 285 - type Error = ButtplugMessageError; 286 - fn try_from(value: ButtplugDeviceMessageType) -> Result<Self, Self::Error> { 287 - match value { 288 - ButtplugDeviceMessageType::VibrateCmd => Ok(ButtplugCurrentSpecDeviceMessageType::VibrateCmd), 289 - ButtplugDeviceMessageType::LinearCmd => Ok(ButtplugCurrentSpecDeviceMessageType::LinearCmd), 290 - ButtplugDeviceMessageType::RotateCmd => Ok(ButtplugCurrentSpecDeviceMessageType::RotateCmd), 291 - ButtplugDeviceMessageType::StopDeviceCmd => { 292 - Ok(ButtplugCurrentSpecDeviceMessageType::StopDeviceCmd) 293 - } 294 - ButtplugDeviceMessageType::RawWriteCmd => { 295 - Ok(ButtplugCurrentSpecDeviceMessageType::RawWriteCmd) 296 - } 297 - ButtplugDeviceMessageType::RawReadCmd => Ok(ButtplugCurrentSpecDeviceMessageType::RawReadCmd), 298 - ButtplugDeviceMessageType::RawSubscribeCmd => { 299 - Ok(ButtplugCurrentSpecDeviceMessageType::RawSubscribeCmd) 300 - } 301 - ButtplugDeviceMessageType::RawUnsubscribeCmd => { 302 - Ok(ButtplugCurrentSpecDeviceMessageType::RawUnsubscribeCmd) 303 - } 304 - ButtplugDeviceMessageType::BatteryLevelCmd => { 305 - Ok(ButtplugCurrentSpecDeviceMessageType::BatteryLevelCmd) 306 - } 307 - ButtplugDeviceMessageType::RSSILevelCmd => { 308 - Ok(ButtplugCurrentSpecDeviceMessageType::RSSILevelCmd) 309 - } 310 - ButtplugDeviceMessageType::ScalarCmd => Ok(ButtplugCurrentSpecDeviceMessageType::ScalarCmd), 311 - ButtplugDeviceMessageType::SensorReadCmd => { 312 - Ok(ButtplugCurrentSpecDeviceMessageType::SensorReadCmd) 313 - } 314 - ButtplugDeviceMessageType::SensorSubscribeCmd => { 315 - Ok(ButtplugCurrentSpecDeviceMessageType::SensorSubscribeCmd) 316 - } 317 - ButtplugDeviceMessageType::SensorUnsubscribeCmd => { 318 - Ok(ButtplugCurrentSpecDeviceMessageType::SensorUnsubscribeCmd) 319 - } 320 - _ => Err(ButtplugMessageError::MessageConversionError( 321 - "Device message deprecated, does not exist in current version of protocol.".to_owned(), 322 - )), 323 - } 324 - } 325 - } 326 - 327 - impl From<ButtplugCurrentSpecDeviceMessageType> for ButtplugDeviceMessageType { 328 - fn from(value: ButtplugCurrentSpecDeviceMessageType) -> Self { 329 - match value { 330 - ButtplugCurrentSpecDeviceMessageType::VibrateCmd => ButtplugDeviceMessageType::VibrateCmd, 331 - ButtplugCurrentSpecDeviceMessageType::LinearCmd => ButtplugDeviceMessageType::LinearCmd, 332 - ButtplugCurrentSpecDeviceMessageType::RotateCmd => ButtplugDeviceMessageType::RotateCmd, 333 - ButtplugCurrentSpecDeviceMessageType::StopDeviceCmd => { 334 - ButtplugDeviceMessageType::StopDeviceCmd 335 - } 336 - ButtplugCurrentSpecDeviceMessageType::RawWriteCmd => ButtplugDeviceMessageType::RawWriteCmd, 337 - ButtplugCurrentSpecDeviceMessageType::RawReadCmd => ButtplugDeviceMessageType::RawReadCmd, 338 - ButtplugCurrentSpecDeviceMessageType::RawSubscribeCmd => { 339 - ButtplugDeviceMessageType::RawSubscribeCmd 340 - } 341 - ButtplugCurrentSpecDeviceMessageType::RawUnsubscribeCmd => { 342 - ButtplugDeviceMessageType::RawUnsubscribeCmd 343 - } 344 - ButtplugCurrentSpecDeviceMessageType::BatteryLevelCmd => { 345 - ButtplugDeviceMessageType::BatteryLevelCmd 346 - } 347 - ButtplugCurrentSpecDeviceMessageType::RSSILevelCmd => ButtplugDeviceMessageType::RSSILevelCmd, 348 - ButtplugCurrentSpecDeviceMessageType::ScalarCmd => ButtplugDeviceMessageType::ScalarCmd, 349 - ButtplugCurrentSpecDeviceMessageType::SensorReadCmd => { 350 - ButtplugDeviceMessageType::SensorReadCmd 351 - } 352 - ButtplugCurrentSpecDeviceMessageType::SensorSubscribeCmd => { 353 - ButtplugDeviceMessageType::SensorSubscribeCmd 354 - } 355 - ButtplugCurrentSpecDeviceMessageType::SensorUnsubscribeCmd => { 356 - ButtplugDeviceMessageType::SensorUnsubscribeCmd 357 - } 358 - } 359 - } 360 - } 361 244 362 245 /// Represents all possible messages a 363 246 /// [ButtplugClient][crate::client::ButtplugClient] can send to a