tokio: `tokio-codec` does not contain `length_delimited`

Version

tokio-codec 0.1.1 tokio-io 0.1.9

Platform

Linux 4.18.10-arch1-1-ARCH #1 SMP PREEMPT x86_64

Subcrates

tokioc-codec tokio-io

Description

PR #568 deprecated tokio_io::codec::length_delimited. The deprecation warnings, e.g.

warning: use of deprecated item 'tokio_io::codec::length_delimited': Moved to tokio-codec

claim the module has been moved to tokio-codec, however this is not the case. tokio now contains a codec::length_delimited module, but the tokio-codec crate does not. Users who do not use the tokio crate have therefore no upgrade path.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 16 (13 by maintainers)

Commits related to this issue

Most upvoted comments

A Cargo.toml such as

[package]
name    = "foo"
version = "0.1.0"

[target.'cfg(target_arch = "wasm32")'.dependencies]
tokio = { version = "0.1.14", default-features = false, features = ["io"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "0.1.14", default-features = false, features = ["io", "tcp"] }

which selects different tokio features depending on the target architecture will ― for all target architectures ― build with the union of all feature sets. The example will therefore fail to compile on wasm32.

I don’t like having to depend on tokio crate from library crate.

That’s a good reason.

While using tokio::codec instead of tokio_codec might work, I don’t like having to depend on tokio crate from library crate. I have a library crate that uses length_delimited but I don’t want to force users into depending on lot of other things in all tokio-related crates that they don’t use.

Please consider adding length_delimited to tokio_codec itself.