[package]
name = "edgy-s"
version = "1.3.5"
edition = "2024"
authors = ["SmileSky <mzdk100@foxmail.com>"]
license = "Apache-2.0"
description = "A minimalist WebSocket bidirectional RPC framework for building microservice applications"
repository = "https://github.com/mzdk100/edgy-s.git"
readme = "README.md"
keywords = ["websocket", "rpc", "microservice", "bidirectional", "async"]
categories = ["network-programming", "web-programming::websocket", "asynchronous"]

[[example]]
name = "crates_io_search"
required-features = ["client"]

[[example]]
name = "basic_client"
required-features = ["client"]

[[example]]
name = "basic_server"
required-features = ["server"]

[[example]]
name = "stream_client"
required-features = ["client"]

[[example]]
name = "stream_server"
required-features = ["server"]

[[example]]
name = "state_client"
required-features = ["client"]

[[example]]
name = "state_server"
required-features = ["server"]

[[example]]
name = "http_to_ws"
required-features = ["server"]

[features]
default = ["postcard", "req_id_u8"]

# Request ID width configuration
# Choose one based on your concurrency requirements
req_id_u8 = []   # Default: supports up to 256 concurrent requests (u8)
req_id_u16 = []  # Supports up to 65,536 concurrent requests (u16)
req_id_u32 = []  # Supports up to ~4.2 billion concurrent requests (u32)
req_id_u64 = []  # Virtually unlimited concurrent requests (u64)

# Serialization backend - choose exactly one
cbor4 = ["cbor4ii/use_std", "cbor4ii/serde1", "serde/derive"]
postcard = ["postcard/alloc", "serde/derive"]
serde_json = ["serde_json/default", "serde/derive"]

client = [
    "futures-util/default",
    "hyper/http1",
    "hyper/client",
    "hyper-util/tokio",
    "hyper-util/client-legacy",
    "hyper-util/http1",
    "hyper-tls",
    "parking_lot/arc_lock",
    "percent-encoding/default",
    "serde/default",
    "tokio/net",
    "tokio/sync",
    "tokio/rt",
    "tokio/rt-multi-thread",
    "tokio/macros",
    "tokio-tungstenite/default",
    "tracing/default"
]
server = [
    "futures-util/default",
    "futures-util/async-await-macro",
    "hyper/http1",
    "hyper/server",
    "hyper-util/tokio",
    "parking_lot/arc_lock",
    "percent-encoding/default",
    "serde/default",
    "tokio/net",
    "tokio/sync",
    "tokio/rt",
    "tokio/rt-multi-thread",
    "tokio/macros",
    "tokio-tungstenite/default",
    "tokio-util",
    "tracing/default",
]

[dependencies]

[dependencies.cbor4ii]
version = "1.2.2"
optional = true

[dependencies.parking_lot]
version = "0.12.5"
optional = true

[dependencies.serde_json]
version = "1.0.149"
optional = true

[dependencies.tracing]
version = "0.1.44"
optional = true

[dependencies.tokio]
version = "1.51.1"
optional = true

[dependencies.futures-util]
version = "0.3.32"
optional = true

[dependencies.serde]
version = "1.0.228"
optional = true

[dependencies.hyper-util]
version = "0.1.20"
optional = true

[dependencies.hyper]
version = "1.9.0"
optional = true

[dependencies.tokio-tungstenite]
version = "0.29.0"
optional = true

[dependencies.tokio-util]
version = "0.7.18"
optional = true

[dependencies.percent-encoding]
version = "2.3.2"
optional = true

[dependencies.postcard]
version = "1.1.3"
optional = true

[dependencies.hyper-tls]
version = "0.6.0"
optional = true

[dev-dependencies]
anyhow = "1.0.102"
async-stream = "0.3.6"
tokio = {version = "1.51.1", features = ["macros", "rt-multi-thread", "time"]}
tracing-subscriber = "0.3.23"