Skip to content

Conversation

@Fokko
Copy link
Collaborator

@Fokko Fokko commented Oct 1, 2025

What changes are proposed in this pull request?

ByteBuf is a small wrapper that makes handling bytes more efficient:

https://docs.rs/serde_bytes/latest/serde_bytes/struct.ByteBuf.html

How was this change tested?

@codecov
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.90%. Comparing base (82fa82e) to head (19dfbf9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1361      +/-   ##
==========================================
+ Coverage   84.89%   84.90%   +0.01%     
==========================================
  Files         113      113              
  Lines       28923    28923              
  Branches    28923    28923              
==========================================
+ Hits        24553    24556       +3     
+ Misses       3198     3197       -1     
+ Partials     1172     1170       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@zachschuermann zachschuermann left a comment

Choose a reason for hiding this comment

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

do we have a use case for this yet? should we perhaps consider using just normal Vec or Bytes before optimizing? Or do we already know this optimization has utility?

@Fokko
Copy link
Collaborator Author

Fokko commented Oct 4, 2025

Great question. Vec<u8> does not translate well, since that will be turned into an ArrayType:

// ToDataType impl for non-nullable array types
impl<T: ToDataType> ToDataType for Vec<T> {
fn to_data_type() -> DataType {
ArrayType::new(T::to_data_type(), false).into()
}
}

After looking a bit more into it, I think Bytes will also work. The bytes will mostly contain DVs that we need to slice out.

@github-actions github-actions bot added the breaking-change Change that require a major version bump label Oct 4, 2025
@Fokko Fokko changed the title Support ByteBuf mapping to Binary in ToSchema Support Bytes mapping to Binary in ToSchema Oct 4, 2025
@Fokko Fokko closed this Oct 6, 2025
@Fokko Fokko deleted the fd-support-binary branch October 6, 2025 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Change that require a major version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants