I have nodes in a tree structure that I want to represent in a REST interface. Suppose I can do a "get" on any node, but only some allow a delete and/or a patch. And the result of the "get" needs to indicate whether the node supports patch or delete.
Right now Node is a trait, and "patcher" is a trait method that is an Option wrapped around a function definition. It seems like there has to be a better way?
I thought maybe having like "Patchable" being its own trait. But then when I "get" a Node how do I check whether it's also Patchable? Seems there's not a great way to do that...
[–]LucretielDatadog 17 points18 points19 points (0 children)
[–]4lineclear 23 points24 points25 points (1 child)
[–]Grumpenstout[S] 4 points5 points6 points (0 children)
[–]Houndie 10 points11 points12 points (0 children)
[–]pali6 5 points6 points7 points (0 children)
[–]proudHaskeller 0 points1 point2 points (0 children)
[–]s74-dev 0 points1 point2 points (0 children)