repr: ByteString to represent u8 vectors#35017
Draft
antiguru wants to merge 2 commits intoMaterializeInc:mainfrom
Draft
repr: ByteString to represent u8 vectors#35017antiguru wants to merge 2 commits intoMaterializeInc:mainfrom
antiguru wants to merge 2 commits intoMaterializeInc:mainfrom
Conversation
Pre-merge checklist
|
Introduce explicit `ByteString` type to represent byte vectors. This creates more clarity around types (it's not multiple byte arguments) and allows us to have implementations for vectors that would otherwise conflict. No behavior changes expected. Signed-off-by: Moritz Hoffmann <antiguru@gmail.com>
2ffc90b to
bcc6eeb
Compare
teskje
reviewed
Feb 16, 2026
Contributor
teskje
left a comment
There was a problem hiding this comment.
Looks reasonable to me. I don't quite follow the motivation. The comments say that these types let us avoid conflicting impls, but the PR doesn't introduce any impls on the new types, except for the ones that already existed on Vec<u8>. Can you give an example of a thing we can do now that we couldn't do before?
| } | ||
|
|
||
| impl AsColumnType for Vec<u8> { | ||
| /// A byte string reference, equivalent to `&[u8]` |
Contributor
There was a problem hiding this comment.
This is not quite true, right? ByteStr is not a reference but is expected to be used behind a reference. It's equivalent to [u8], not &[u8].
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Introduce explicit
ByteStringandByteStrtypes to represent byte vectors and slices. This creates more clarity around types (it's not multiple byte arguments) and allows us to have implementations for vectors and slices that would otherwise conflict. No behavior changes expected.