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

Upgrade bytes to 0.5 #1351

Closed
expenses opened this issue Dec 13, 2019 · 4 comments
Closed

Upgrade bytes to 0.5 #1351

expenses opened this issue Dec 13, 2019 · 4 comments

Comments

@expenses
Copy link
Contributor

Version 0.5 of the bytes crate has several breaking changes that mean we lose backwards compatibility with older versions. This causes some problems as soketto uses bytes 0.5, while we use bytes 0.4.

@twittner
Copy link
Contributor

This causes some problems as soketto uses bytes 0.5, while we use bytes 0.4.

What problems exactly?

@expenses
Copy link
Contributor Author

@twittner The versions are incompatible so you can't pass bytes from soketto to libp2p. This prevents me from being able to downgrade a websocket transport to the inner transport and keep the bytes buffer.

@twittner
Copy link
Contributor

You can keep and use any bytes-0.5 types encapsulated within your transport. The transport's output type would most likely have to implement AsyncRead and AsyncWrite and when implementing these traits you are free to operate on those buffers.

@tomaka
Copy link
Member

tomaka commented Jan 2, 2020

#1353 mostly did the upgrade, but leaving open as there's still a bytes 0.4 in multistream-select EDIT: multiaddr.

bltavares added a commit to bltavares/rust-libp2p that referenced this issue Jan 2, 2020
`bytes` 0.5 had a couple of breaking changes, specially the split of
`Bytes` and `BytesMut`.

Given how much this code use methods avaialable only on `BytesMut`, this
comit changes the internal field to use this struct and some smaller
code changes to adapt to it.

Closes libp2p#1351
@tomaka tomaka closed this as completed Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants