+5
-5
crates/intiface_engine/src/rest_server.rs
+5
-5
crates/intiface_engine/src/rest_server.rs
···
21
21
use buttplug_server::ButtplugServer;
22
22
use futures::{Stream, StreamExt};
23
23
use serde::Serialize;
24
-
use strum::IntoEnumIterator;
25
24
use thiserror::Error;
26
25
use tokio::net::TcpListener;
27
26
···
35
34
InvalidDevice(u32),
36
35
#[error("Device index {0} feature index {1} does not refer to a valid device feature.")]
37
36
InvalidFeature(u32, u32),
37
+
/*
38
38
#[error("{0} is not a valid output type. Valid output types are: {1:?}")]
39
39
InvalidOutputType(String, Vec<OutputType>),
40
40
#[error("{0} is not a valid input type. Valid input types are: {1:?}")]
···
43
43
InvalidInputCommand(u32, Vec<String>),
44
44
#[error("Value {0} is not valid for the current command.)")]
45
45
InvalidValue(u32),
46
+
*/
46
47
}
47
48
48
49
// Tell axum how `AppError` should be converted into a response.
···
237
238
)
238
239
}
239
240
241
+
/*
240
242
async fn feature_input_command(
241
243
State(client): State<Arc<ButtplugClient>>,
242
244
Path((index, feature_index, input_type, command)): Path<(u32, u32, String, String)>,
243
245
) -> Result<(), IntifaceRestError> {
244
-
/*
245
246
let cmd = convert_output_command(&command, level)?;
246
247
247
248
Ok(
···
250
251
.await
251
252
.map_err(|e| IntifaceRestError::ButtplugClientError(e))?,
252
253
)
253
-
*/
254
+
254
255
Ok(())
255
256
}
257
+
*/
256
258
257
259
async fn server_sse(
258
260
State(client): State<Arc<ButtplugClient>>,
···
297
299
"/devices/{index}/inputs/{input_type}/{input_command}",
298
300
put(device_input_command),
299
301
)
300
-
*/
301
302
.route(
302
303
"/devices/{index}/features/{index}/inputs/{input_type}/{input_command}",
303
304
put(feature_input_command),
304
305
)
305
-
/*
306
306
.route("/devices/{index}/events", get(device_sse))
307
307
*/
308
308
.route("/events", get(server_sse))