It would be very helpful if you could add the error message you receive and the code where it occurs to your question. Also a hint on the behaviour your program exhibits versus the behaviour you expect could be beneficial to us so we can help you better.
I assume you mean this endpoint?
Here you are not trying to send JSON to the frontend but try to embed a Vec<String> into a handlebars template.
Now this looks wrong to me:
let mut vector=Vec::new();
vector.push(selecting.to_owned());
First, you forgot to actually call selecting here. Also, I assume you want to, pass Vec<String> to your template. What you are constructing here (once you call selecting) would be Vec<Result<Vec<String>, ()>>. Try this instead:
- let mut vector=Vec::new();
- vector.push(selecting.to_owned());
// don't panic your endpoint in production
// (pass a proper error to the client instead),
// but for testing its fine.
+ let vector = selecting().unwrap();
and pass that to your template.
I hope this will help. Without error message I'm limited to guesswork here.