I am still very new to Rust and have been wondering if there is a way to have a function take in different types of arguments in one args place. Lets say
fn fun( a: String) or it could take
fn fun( a: Vec<String>) is this possible? Should this even be done if it is possible? And if not what other way could I accomplish this kind of functionality. I need to have a fn that takes in either a tuple or a vector.
One alternative I have thought about is having a tuple that can take either a str or vector. I am trying to make a function that can take a matrix and select specific indexes to extract from the matrix to create a new matrix from. Say a matrix of 11 columns and 4 rows. I want all the rows minus the 1st, and columns 1 and 2. Something like pandas iloc where you get a dataset from a .csv and convert it to a dataframe by copying over the content. So dataset.iloc[:, :-1].values would give me all the rows and all but the last column back as a matrix.