This question is related with this one opened previously for me, but summarizing "the big deal".
Given this:
pub trait TraitA {}
Is it possible in Rust, having a &dyn TraitA
as argument of a function, "casting it" or convert it in some way to an impl
expr?
Like this:
fn a<'a>(param: &'a dyn TraitA) {
b( param ) // param should be converted
}
where b
is a external function which has a signature like this:
fn b(param: impl IntoSql<'a> + 'a);