[package]
edition = "2021"
rust-version = "1.71"
name = "peekable"
version = "0.5.0"
build = "build.rs"
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Buffered peek for `Read` and async readers (tokio, futures): inspect incoming bytes without consuming them. Useful for protocol detection, length-prefixed framing, and header inspection."
homepage = "https://github.com/al8n/peekable"
documentation = "https://docs.rs/peekable"
readme = "README.md"
keywords = [
"peek",
"buffered",
"async",
"tokio",
"futures",
]
categories = [
"asynchronous",
"network-programming",
"data-structures",
]
license = "MIT OR Apache-2.0"
repository = "https://github.com/al8n/peekable"
[package.metadata.docs.rs]
all-features = true
rustdoc-args = [
"--cfg",
"docsrs",
]
[features]
default = ["smallvec"]
future = [
"futures-util",
"pin-project-lite",
]
tokio = [
"dep:tokio",
"pin-project-lite",
"bytes",
]
[lib]
name = "peekable"
path = "src/lib.rs"
[[example]]
name = "smol"
path = "examples/smol.rs"
required-features = ["future"]
[[example]]
name = "sync"
path = "examples/sync.rs"
[[example]]
name = "tokio"
path = "examples/tokio.rs"
required-features = ["tokio"]
[[test]]
name = "futures_io"
path = "tests/futures_io.rs"
[[test]]
name = "sync"
path = "tests/sync.rs"
[[test]]
name = "tokio_io"
path = "tests/tokio_io.rs"
[dependencies.bytes]
version = "1"
optional = true
[dependencies.futures-util]
version = "0.3"
features = ["io"]
optional = true
[dependencies.pin-project-lite]
version = "0.2"
optional = true
[dependencies.smallvec]
version = "1"
optional = true
[dependencies.tinyvec]
version = "1"
features = ["alloc"]
optional = true
[dependencies.tokio]
version = "1"
features = ["io-util"]
optional = true
default-features = false
[dev-dependencies.futures]
version = "0.3"
features = ["executor"]
[dev-dependencies.smol]
version = "2"
[dev-dependencies.tokio]
version = "1"
features = ["full"]
[lints.rust]
rust_2018_idioms = "warn"
single_use_lifetimes = "warn"
[lints.rust.unexpected_cfgs]
level = "warn"
priority = 0
check-cfg = [
"cfg(all_tests)",
"cfg(tarpaulin)",
]