String::borrow vs String::as_str both would give &str. I would like to use borrow() for possibility to later refactor structures to Cow<str>, but would that incur any extra costs due to .borrow() being a trait method?
I guess compiler might optimise that as it is a trait on a predefined type.
To be clear: this means that in pretty much all cases except for dyn Trait, static dispatch is used. (For dyn Trait, a vtable is built and indirect calls are made, usually.)
So, unless you specifically request dynamism, traits remain a purely compile-time construct.