toy-rpc 0.10.0

An async RPC that mimics golang net/rpc's usage and supports both async-std and tokio
[package]
name = "toy-rpc"
version = "0.10.0"
authors = ["Minghua Wu <michael.wu1107@gmail.com>"]
edition = "2018"
description = "An async RPC that mimics golang net/rpc's usage and supports both async-std and tokio"
license = "MIT/Apache-2.0"
documentation = "https://docs.rs/toy-rpc/"
homepage = "https://github.com/minghuaw/toy-rpc"
repository = "https://github.com/minghuaw/toy-rpc"
keywords = ["async", "rpc", "go", "async-std", "tokio"]
categories = ["network-programming", "asynchronous"]
readme = "Readme.md"
exclude = [
    "examples/*",
    "transport/*",
    ".gitignore",
    ".idea/*",
    ".vscode/*",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[package.metadata.docs.rs]
all-features = true
features = ["docs"]
rustdoc-args = ["--cfg", "feature=\"docs\""]

[features]
default = [
    "serde_bincode",
    # "server",
    # "client",
    # "tokio_runtime",
    # "ws_tokio",
    # "http_actix_web",
]

docs = []

server = ["toy-rpc-macros/server"]
client = ["toy-rpc-macros/client"]
tls = ["rustls", "tokio-rustls", "futures-rustls", "webpki"]
ws_tokio = ["tungstenite", "async-tungstenite/tokio-runtime"]
ws_async_std = ["tungstenite", "async-tungstenite/async-std-runtime"]
 
# feature flags for codec
serde_bincode = []
serde_rmp = ["rmp-serde"]

# feature flags for runtime
tokio_runtime = ["tokio", "tokio-stream", "toy-rpc-macros/runtime", "brw/tokio"]
async_std_runtime = ["async-std", "toy-rpc-macros/runtime", "brw/async-std"]
http_tide = ["tide", "tide-websockets", "ws_async_std", "async_std_runtime", "server",]
http_warp = ["warp", "ws_tokio", "tokio_runtime", "server"]
http_axum = ["axum", "http-body", "bytes", "ws_tokio", "tokio_runtime", "server"]

[dev-dependencies]
async-std = "1.9.0"
anyhow = "1.0.38"
tokio = { version = "1", features = ["rt-multi-thread", "sync"]}
warp = { version = "0.3" }
actix-rt = "2"
actix-web = "4"
hyper = "1"

[dependencies]
# local imports
# toy-rpc-macros = { version = "0.6.3", path="../macros" }
toy-rpc-macros = "0.6.3"

# feature gated optional dependecies
serde_json = { version = "1.0", optional = true }
serde_cbor = { version = "0.11", optional = true }
rmp-serde = { version = "1.1.0", optional = true }
tide = { version = "0.16", optional = true }
tide-websockets =  { version = "0.4.0", git = "https://github.com/minghuaw/tide-websockets", optional = true, rev = "6ece38f" }
warp = { version = "0.3", optional = true }
axum = { version = "0.7.5", optional = true, features = ["ws"] }
hyper = { version = "1", optional = true }
http-body = { version = "1", optional = true }
bytes = { version = "1.0.1", optional = true }
tower-service = { version = "0.3.1", optional = true }
async-std = { version = "1", optional = true }
tokio = { version = "1", features = ["rt-multi-thread", "io-util", "net", "time"], optional = true }
tokio-stream = {  version = "0.1", features = ["net"], optional = true }
tokio-rustls = { version = "0.26", optional = true }
futures-rustls = { version = "0.26", optional = true }
rustls = { version = "0.23", optional = true }
webpki = { version = "0.22", optional = true }
anyhow = { version = "1", optional = true }
tungstenite = { version = "0.21", optional = true }
async-tungstenite = { version = "0.25", optional = true }

bincode = { version = "1.3" }
serde = { version = "1.0", features = ["derive"] }
erased-serde = "^0.4"
futures = "0.3"
async-trait = "0.1"
log = "0.4"
lazy_static = "1.4"
url = "2.2"
cfg-if = "1.0"
thiserror = "1.0"
flume = "0.10"
pin-project = "1.0"
crossbeam = "0.8"
brw = { version = "^0.1.7" }

[[test]]
name = "async_std_tcp"
path = "tests/async_std_tcp.rs"
required-features = ["async_std_runtime", "server", "client"]

[[test]]
name = "tokio_tcp"
path = "tests/tokio_tcp.rs"
required-features = ["tokio_runtime", "server", "client"]

[[test]]
name = "async_std_ws"
path = "tests/async_std_ws.rs"
required-features = ["async_std_runtime", "server", "client", "ws_async_std"]

[[test]]
name = "tokio_ws"
path = "tests/tokio_ws.rs"
required-features = ["tokio_runtime", "server", "client", "ws_tokio"]

[[test]]
name = "tide_integration"
path = "tests/tide_integration.rs"
required-features = ["http_tide", "server", "client"]

[[test]]
name = "warp_integration"
path = "tests/warp_integration.rs"
required-features = ["http_warp", "server", "client"]

[[test]]
name = "axum_integration"
path = "tests/axum_integration.rs"
required-features = ["http_axum", "server", "client"]