{ }
Вот &dyn Trait точно приводит.
Мне кажется что в сигнатуре функции указывается ссылка на тип реализующий трэйт, т.е. будет мономорфизация.
In argument position, impl Trait is very similar in semantics to a generic type parameter. However, there are significant differences between the two in return position. With impl Trait, unlike with a generic type parameter, the function chooses the return type, and the caller cannot choose the return type. https://doc.rust-lang.org/reference/types/impl-trait.html
Шикарно, спасибо.
Обсуждают сегодня