I am using the Rocket web framework and I need to create a function with a generic parameter type parameter:
use rocket_contrib::json::{Json, JsonValue};
fn bluid_succes_response<T>(data: T) -> JsonValue {
json!(data)
}
This is the error I have:
the trait `dataStructures::parameters_structures::_::_serde::Serialize` is not implemented for `T`
How can I implement the Serialize
trait for a generic type like T
or is there another way to solve the problem?