Function to_variant

Source
pub fn to_variant<T: TryFrom<Data>>(data: Vec<Data>) -> Vec<T>
Expand description

Converts a vector of Data items to a specific variant type.

Filters and converts the data vector, keeping only items that can be successfully converted to the target type T.