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.
The Abomonation crate allows transmutation of types into buffers of memory and back again. This is useful for caches, where it makes it possible to serve read-only references of the item directly out of the cache memory.
Abomonation implements support for normal vectors, however it needs each type to implement the
Abomonation
trait in order for it to work on them. We have structures containing smallvecs that we'd like to serialize with Abomonation, but currently can't as it doesn't implement the trait.This change adds a new feature (
abomonation
) to the smallvec crate which provides abomonation support forSmallVec
if specified. The implementation is based on the AbomonationVec
implementation, with the unspilled special case accounted for: the data is inline, so doesn't need to be stored separately.I've put this behind a feature flag as I'm sure most users won't want it. However we might not be the only ones using both SmallVec and Abomonation, so I thought I'd share it to see if there is interest in incorporating it here.