I'm not sure if it's the right terminology, but there are certain traits that are designed for transforming types. For example,
FromStr or Actix's
Responder. (This last one being what's prompted the question in the first place)
In many cases, these get implemented because that transformation is done in many places, so it's avoiding repetition.
However, in some cases the this will only be done once. Converting an internal struct into one returned from a REST API, for example.
Obviously I can just do the transformation in place where it's needed. But I could also do it via the appropriate trait, which feels like a bit more code to manage but also a lot easier to unit test - the transformation can be tested on it's own in as many varieties as needed without anything else.
Is this implementation of such a trait for a single use a reasonable/common style? Or is it more trouble than its worth?