Closed sempervictus closed 3 years ago
Implementing idiomatic traits like clone
is definately something I'm keen to do even though I'll have to go read up on what's involved.
I'm curious to see if we're better off cloning to a new object by cloning the underlying data (eg clone segments, each of which impl's clone by cloning it's fields), or simply cloning the source message String and generating a whole new Message
by calling parse
on the cloned hl7 string and returning that...
Of course if it's as simple as a derive
...
Check the PR - clone()
and subsequently to_owned()
now work :)
Closing for 957c3a65803964a7215e14a3a3abf596a1ad928e
A number of functions break when Clone isn't implemented for a Type, including things like to_owned() due to:
Now that we can extract pieces of messages as owned elements, i think we can leverage that to clone new messages from existing ones by extracting to a new object. Thoughts?