Skip to content
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

Remove buffer -> dtype dependency #309

Merged
merged 5 commits into from
May 11, 2024
Merged

Remove buffer -> dtype dependency #309

merged 5 commits into from
May 11, 2024

Conversation

gatesn
Copy link
Contributor

@gatesn gatesn commented May 11, 2024

Part of my refactor to turn vortex-buffer into our equivalent of the "bytes" crate

TODO: remove match_integers_by_width which previously was used for unchecked transmute

@gatesn gatesn requested a review from robert3005 May 11, 2024 08:20
@gatesn gatesn enabled auto-merge (squash) May 11, 2024 08:28
@gatesn gatesn disabled auto-merge May 11, 2024 10:04
@gatesn gatesn merged commit fd3a72b into develop May 11, 2024
1 check passed
@gatesn gatesn deleted the ngates/typed-data branch May 11, 2024 10:04
}),
// Cannot always convert bytes into a mutable vec
Buffer::Arrow(buffer) => buffer.into_vec::<u8>().map_err(Buffer::Arrow),
// Cannot convert bytes into a mutable vec
Buffer::Bytes(_) => Err(self),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this an Err? If you are the only one holding the bytes then this should be possible

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you can go from Bytes back to BytesMut

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://rustasync.github.io/runtime/bytes/struct.Bytes.html#method.try_mut seems to be the right signature and then you can use that to construct vec from parts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 I missed that. I thought it seemed odd

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm no, I'm not sure what docs those are but they're not up-to-date for the bytes crate. See also tokio-rs/bytes#350

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like someone is hosting their own fork or some outdated link that google served. You’re right. Maybe we need our own version as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do anyway to have more control over alignment. This crate tries to abstract that away for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants