I am trying to use generics in Rust and have encountered a probem when trying to define a function.
Let a method get
take in a Vector where its type is generic, for example
fn get<T1: serde::Serialize, T2: serde::Serialize>(input: Vec<T>)
where T can be either T1 or T2
I am trying to define the function properly especially I am stuck at the point where I need to define T such that it can either be T1 or T2.
Is this possible in Rust?