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

Confusing documentation around Arc<[u8]> compatibility #685

Open
BTOdell opened this issue Mar 27, 2024 · 1 comment
Open

Confusing documentation around Arc<[u8]> compatibility #685

BTOdell opened this issue Mar 27, 2024 · 1 comment

Comments

@BTOdell
Copy link

BTOdell commented Mar 27, 2024

The latest documentation of the crate reads:

For Bytes implementations which point to a reference counted shared storage (e.g. an Arc<[u8]>),
sharing will be implemented by increasing the reference count.

Reference: https://docs.rs/bytes/latest/bytes/struct.Bytes.html#sharing

This lead me to assume that Bytes should provide a from conversion function from an Arc<[u8]> to a Bytes instance where the backing storage is an Arc. However, it doesn't appear that this from function exists.

I don't think it's a good idea for documentation to reference imaginary scenarios that aren't implemented by the library as it sets up false expectations with regard to how the library works and what features it provides.

@Sytten
Copy link
Contributor

Sytten commented Apr 12, 2024

It in fact quite useful, but it should do a better job at being compatible

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

No branches or pull requests

2 participants