apache / arrow-rs

Official Rust implementation of Apache Arrow
https://arrow.apache.org/
Apache License 2.0
2.62k stars 802 forks source link

Public API using private types: `Buffer::from_bytes` takes unexported `Bytes` #6754

Open tv42 opened 3 days ago

tv42 commented 3 days ago

Describe the bug

https://docs.rs/arrow-buffer/53.2.0/arrow_buffer/buffer/struct.Buffer.html#method.from_bytes

/// Auxiliary method to create a new Buffer
pub fn from_bytes(bytes: Bytes) -> Self

This method is in the public API, but cannot be called.

Expected behavior

  1. All types used by public API are public.

Any outside users looking at this are probably better served by Buffer::from_vec.

tustvold commented 3 days ago

We should probably make from_bytes crate private, agreed