Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Sundog to handle dynamic settings #49
Add Sundog to handle dynamic settings #49
Changes from 8 commits
d2d824e
e4a545d
fb8cc6a
ceab4db
d2e008a
3253092
8755f6e
2ac7207
84b222f
77c2774
48901c0
53476b7
6631a46
35f3413
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We tested together and found an issue here.
from_map
is a datastore-level construct, which means it assumes you're serializing/deserializing as necessary. That's not fair for users outside of the API server, who shouldn't have to know anything about the ser/de going on inside. I'm planning on making a higher-levelfrom_map
-type function that'spub
, and that handles the ser/de internally. I hope to have that within a (working) day or two so you can update this with minimal changes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After further thought, I'm not sure what I wanted is possible.
Important background:
Because of this, the options for deserializing from a collection are:
Note: You can't have the values be serde's Serialize type because it's not object safe -- this means you can't have a collection of
Box<Serialize>
, for example, or accept aHashMap<String, Serialize>
; all things must be the same type that implements Serialize.So, unfortunately, I'm not aware of a way to make a higher-level interface for something like
from_map
that completely hides the serialization requirement. I did make serialization helpers so you don't have to care about the exact serialization format - we use JSON, but could switch.@zmrow - I think the right answer is for you to call
datastore::serialize_scalar()
on the output of the generators and store the resulting string in your HashMap; then you canfrom_map
that into a Settings as you are now.