-
Notifications
You must be signed in to change notification settings - Fork 65
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
Exposing Serializer in the public API #18
Comments
@trepetti Basically, I find my current approach to the different types to be not something I want to stabilize yet. I see two approaches:
|
@npmccallum Thank you for laying out these options. For the first option, would making an API that focuses on analogy to If this isn't the direction you wanted to go in towards a stable API, I completely understand. And regardless, I think putting it initially behind a feature flag would be prudent (have not done that in this POC, though). It looks like there is no way to have the Let me know what you think. I would implement the corresponding |
erased_serde also depend on |
In looking at the
and modify everywhere that references
Let me know what you think. Since |
@trepetti Apologies for the lack of response. I was on vacation. :) I'm fine with the first approach too. The |
@npmccallum Hope you had a good vacation! One last pair of questions before I put together a PR: if we expose scratch, is it also worth exposing the recursion limit, too? For either or both we could have |
@trepetti We should probably just work through these details in the PR review. |
A couple of serde helper libraries also require the
What would be required to clean them up? I did not see that yet in the thread. |
They currently leverage some internal generic types which are intended to promote code sharing, but probably aren't a good public interface. These would have to be reworked to something more reasonable. |
Thanks for the info. The internal generic types could still remain private and only the For the Serializer the only constraint is to also expose CollectionSerializer. For the Deserializer the scratch space "leaks" because of the lifetime. You can abstract it away and provide a constructor for a |
I apologize for dropping the ball on this. I have been using this initial attempt at exposing On the deserialization side, this branch is a reasonably well fleshed-out attempt at what going with option 1 for In going further to flesh out the equivalent of |
@trepetti I'm not sure where the best place to post feedback is, so just place it here to keep the discussion in one place.
|
I am also looking into using the public |
|
Hi all,
I saw that Nathaniel mentioned the possibility of exposing the
Serializer
in the public API in pyfisch/cbor#179 (comment). I was wondering what steps or contributions you would be looking for getting it into a state where that would be a possibility. Not sure how many other people share my use-case, but I have been usingSerializer::serialize_seq()
for outputting logs to disk (with some intervening compression) withserde_json
and was curious about moving to CBOR. I know there is more involved than just droppingpub
in front ofciborium/ciborium/src/ser/mod.rs
Line 16 in 06cafa7
I can help by coming up with doc strings for
rustdoc
to put it on par withserde_json
's treatment ofSerializer
if that would help.Let me know what you think and thanks for all your work on this crate.
-Tom
The text was updated successfully, but these errors were encountered: