tangled
alpha
login
or
join now
buttplug.io
/
buttplug
20
fork
atom
Buttplug sex toy control library
20
fork
atom
overview
issues
pulls
pipelines
chore: remove unused classes in config
qdot.tngl.sh
6 months ago
e4242575
73f1200e
+1
-32
1 changed file
expand all
collapse all
unified
split
crates
buttplug_server_device_config
src
device_configuration.rs
+1
-32
crates/buttplug_server_device_config/src/device_configuration.rs
···
13
13
DeviceSettings,
14
14
ProtocolCommunicationSpecifier,
15
15
ServerBaseDeviceFeature,
16
16
-
UserDeviceCustomization,
17
16
UserDeviceDefinition,
18
17
UserDeviceIdentifier,
19
18
};
20
19
use buttplug_core::{
21
20
errors::{ButtplugDeviceError, ButtplugError},
22
22
-
message::OutputType,
23
21
util::json::JSONValidator,
24
22
};
25
23
use dashmap::DashMap;
26
24
use getset::{CopyGetters, Getters, MutGetters, Setters};
27
25
use serde::{Deserialize, Serialize};
28
28
-
use std::{collections::HashMap, fmt::Display, ops::RangeInclusive};
26
26
+
use std::{collections::HashMap, fmt::Display};
29
27
use uuid::Uuid;
30
28
31
29
pub static DEVICE_CONFIGURATION_JSON: &str =
···
87
85
pub defaults: Option<ProtocolAttributes>,
88
86
#[serde(default)]
89
87
pub configurations: Vec<ProtocolAttributes>,
90
90
-
}
91
91
-
92
92
-
#[derive(Deserialize, Serialize, Debug, Clone, Getters, Setters, MutGetters)]
93
93
-
#[getset(get = "pub", set = "pub", get_mut = "pub(crate)")]
94
94
-
struct UserFeatureOutputCustomization {
95
95
-
step_limit: RangeInclusive<u32>,
96
96
-
reverse_position: bool,
97
97
-
}
98
98
-
99
99
-
#[derive(Deserialize, Serialize, Debug, Clone, Getters, Setters, MutGetters)]
100
100
-
#[getset(get = "pub", set = "pub", get_mut = "pub(crate)")]
101
101
-
struct UserFeatureCustomization {
102
102
-
id: Uuid,
103
103
-
#[serde(rename = "base-id")]
104
104
-
base_id: Uuid,
105
105
-
output: HashMap<OutputType, UserFeatureOutputCustomization>,
106
106
-
}
107
107
-
108
108
-
#[derive(Deserialize, Serialize, Debug, Clone, Getters, Setters, MutGetters)]
109
109
-
#[getset(get = "pub", set = "pub", get_mut = "pub(crate)")]
110
110
-
struct SerializedUserDeviceDefinition {
111
111
-
id: Uuid,
112
112
-
#[serde(rename = "base-id")]
113
113
-
base_id: Uuid,
114
114
-
/// Message attributes for this device instance.
115
115
-
features: Vec<UserFeatureCustomization>,
116
116
-
/// Per-user configurations specific to this device instance.
117
117
-
#[serde(rename = "user-config")]
118
118
-
user_config: UserDeviceCustomization,
119
88
}
120
89
121
90
#[derive(Deserialize, Serialize, Debug, Clone, Getters, Setters, MutGetters)]