Open zicklag opened 4 years ago
As a related note, the reason I'm trying to figure this out is because I want to override the Display
implementation of the Varlink errors. Right now I'm planning on using Regex to replace the existing display implementation with my own, but that seems hackish. Do you have any other ideas for a way to do this?
Hmm, easiest thing would be a generator option specifying not to generate the Display trait.
The way I did it was I replaced the generated implementation with an include!
so that it would include my implementation from another file. We could add an alternative_display_impl
option that would be an Option<&Path>
maybe.
Hmm, easiest thing would be a generator option specifying not to generate the Display trait.
That would be useful for other traits too. I just tripped over the
PartialEq
trait which I need to behave differently
(array should be treated as equivalent irrespective of the order
of elements) than the derived one.
I've got a quick question about the varlink generated error types. Take this generated code for example:
I have two user-defined errors in my
.varlink
file:Error
, andHookFailed
. My question is, why are the error arguments inside of anOption
? According to the varlink definition, the error must have the arguments that I have defined, so in what cases would the error Arguments beNone
? I'm mostly trying to figure out if aNone
value in this case should be a panic, or whether or not that can happen in normal operation.