
Generics
Box dyn Trait in Rust and When Allocation Is Worth It
Box<dyn Trait> costs one allocation and one indirect call per use. Learn what that costs, when it is worth it and the cheaper alternatives.
8 min read
Tag
1 post

Box<dyn Trait> costs one allocation and one indirect call per use. Learn what that costs, when it is worth it and the cheaper alternatives.