rruckley / tmflib

A crate covering structures required to interact with TMF APIs
Apache License 2.0
5 stars 0 forks source link

Trait: Hydrate #72

Open rruckley opened 6 months ago

rruckley commented 6 months ago

Discussed in https://github.com/rruckley/tmflib/discussions/71

Originally posted by **rruckley** March 27, 2024 It would be useful to define a trait for any reference type, that defines a function to hydrate a reference into a real payload. To keep it simple, this could just return a string version of the payload that can later be parsed into a struct if required. Then any struct that's defined as a reference can implement this. This would be handy for micro-services but also back-end systems that need to pull in referenced data.
rruckley commented 4 months ago

Consideration for how to represent both a reference to a foreign structure and the foreign structure itself.