What is the difference between impl Trait and dyn Trait?

In very simple terms (which are nonetheless sufficient for this usage):

  • existential quantification means "there exists a type (that satisfies the given bound) and I'm returning it to you"
  • universal quantification means "for all types (that satisfy the given bound), I will accept them"
6 Likes