use crate::message_types::{UIRequest}; /// Pass a pub fn handle_request(socket_message: String) -> Result { println!("Recieved a socket message: {}", socket_message); let request: UIRequest = serde_json::from_str(&socket_message)?; Ok(request) } fn sanitize_input(input: UIRequest) -> Result { // if UIRequest is a search string, make sure it is // not empty // has no %, this is a fuzzy search, This program handles that, maybe replace * with % // has a type of request (e.g. "title search: value") Ok(UIRequest::Pause) }