Remove optional feature serde #28
Merged
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.
CHANGELOG.mdentrySummary
Remove
serdeas an (optional) feature.Motivation
rand_coreis intended to be a pure interface crate; as such it should not depend on anything else.Details
This doesn't affect
chacha20since RustCrypto/stream-ciphers#461.It also doesn't outright prevent block-based RNGs from supporting
serde; it is possible to write remote adapters for foreign types which do not support it, but allowing this would require:BlockRng::results(or only the unused subset)BlockRng64::results,half_usedBlockRngandBlockRng64from partsUltimately (once
rand_coreis stable at v1.0) we could try to get this support merged intoserdeitself, but even if we don't, the loss ofserdesupport forBlockRngshould be acceptable.Unresolved questions
Do we want to provide some way to serialize and deserialize partial buffers?
I suggest the answer should be no: downstream RNGs already support getting/setting the stream position without this.
Exception:
BlockRng64isn't used much. The only application of it we provide (Isaac64Rng) does not support set/get stream position. I think we shouldn't worry about it (and even consider removing it) simply due to the low usage.Future work
#24 can be re-evaluated independently of
serde.