Replies: 1 comment
-
Well, I was finally able to get something that works all-or-none. But it seems way too convoluted and verbose to be the best way to do this, so I'm still hoping for guidance. Things to notice about this:
I scoured docs, examples, discussions all day long and tried dozens of variations that did not work. This is the only one that did. I would suggest that all-or-none is an area ripe for documentation and/or api improvement.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to accept CLI args for optionally sending alert emails.
There are several options like admin_email, smtp_host, smtp_user, smtp_pass, etc.
The requirement is that if any of these are present then all must be present. But it is also ok for none to be present. (all-or-none).
Presently I have:
I thought that the
alert: Option<Alert>
might express the intention that its ok for none of the Alert fields to be present. But when I execute I still get an error that all the fields are required.So how can I achieve the all-or-none requirement?
Beta Was this translation helpful? Give feedback.
All reactions