arora_websocket/
handlers.rs1use crate::method::InvokeResult;
4use arora_types::value::Value;
5use std::collections::HashMap;
6use std::future::Future;
7use std::pin::Pin;
8use std::sync::Arc;
9
10pub type SetSlotValuesResult = Result<(), String>;
12
13pub type SetSlotValuesHandler =
16 Arc<dyn Fn(HashMap<String, Value>) -> SetSlotValuesResult + Send + Sync>;
17
18pub type GetSlotValuesHandler = Arc<
22 dyn Fn(Vec<String>) -> Pin<Box<dyn Future<Output = HashMap<String, Value>> + Send>>
23 + Send
24 + Sync,
25>;
26
27pub type MethodHandler = Arc<dyn Fn(HashMap<String, Value>) -> InvokeResult + Send + Sync>;
29
30pub type OnClientConnectedHandler = Arc<dyn Fn(String) + Send + Sync>;