mod controller; #[cfg(test)] mod tests; use controller::structs::{BasicDate, PickupTime, Street}; use controller::{get_pickup_times, search_streets}; use rocket::http::Status; use rocket_contrib::json::Json; pub fn routes() -> Vec { routes![route_search_streets, route_get_pickup_times] } #[get("/search?")] pub fn route_search_streets(street: String) -> Result>, Status> { Ok(Json(search_streets(&street)?)) } #[get("/?&&&")] pub fn route_get_pickup_times( street: Street, number: u32, start_date: BasicDate, end_date: BasicDate, ) -> Result>, Status> { Ok(Json(get_pickup_times( street, number, start_date, end_date, )?)) }