Skip to content

Commit 0aa7803

Browse files
committed
Add async support to jsonrpc
Update the lockfiles because of the new dev dependency on futures.
1 parent 7302ebd commit 0aa7803

File tree

7 files changed

+279
-30
lines changed

7 files changed

+279
-30
lines changed

Cargo-minimal.lock

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,94 @@ dependencies = [
361361
"percent-encoding",
362362
]
363363

364+
[[package]]
365+
name = "futures"
366+
version = "0.3.32"
367+
source = "registry+https://github.com/rust-lang/crates.io-index"
368+
checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d"
369+
dependencies = [
370+
"futures-channel",
371+
"futures-core",
372+
"futures-executor",
373+
"futures-io",
374+
"futures-sink",
375+
"futures-task",
376+
"futures-util",
377+
]
378+
379+
[[package]]
380+
name = "futures-channel"
381+
version = "0.3.32"
382+
source = "registry+https://github.com/rust-lang/crates.io-index"
383+
checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d"
384+
dependencies = [
385+
"futures-core",
386+
"futures-sink",
387+
]
388+
389+
[[package]]
390+
name = "futures-core"
391+
version = "0.3.32"
392+
source = "registry+https://github.com/rust-lang/crates.io-index"
393+
checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d"
394+
395+
[[package]]
396+
name = "futures-executor"
397+
version = "0.3.32"
398+
source = "registry+https://github.com/rust-lang/crates.io-index"
399+
checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d"
400+
dependencies = [
401+
"futures-core",
402+
"futures-task",
403+
"futures-util",
404+
]
405+
406+
[[package]]
407+
name = "futures-io"
408+
version = "0.3.32"
409+
source = "registry+https://github.com/rust-lang/crates.io-index"
410+
checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718"
411+
412+
[[package]]
413+
name = "futures-macro"
414+
version = "0.3.32"
415+
source = "registry+https://github.com/rust-lang/crates.io-index"
416+
checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b"
417+
dependencies = [
418+
"proc-macro2",
419+
"quote",
420+
"syn",
421+
]
422+
423+
[[package]]
424+
name = "futures-sink"
425+
version = "0.3.32"
426+
source = "registry+https://github.com/rust-lang/crates.io-index"
427+
checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893"
428+
429+
[[package]]
430+
name = "futures-task"
431+
version = "0.3.32"
432+
source = "registry+https://github.com/rust-lang/crates.io-index"
433+
checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393"
434+
435+
[[package]]
436+
name = "futures-util"
437+
version = "0.3.32"
438+
source = "registry+https://github.com/rust-lang/crates.io-index"
439+
checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6"
440+
dependencies = [
441+
"futures-channel",
442+
"futures-core",
443+
"futures-io",
444+
"futures-macro",
445+
"futures-sink",
446+
"futures-task",
447+
"memchr",
448+
"pin-project-lite",
449+
"slab",
450+
]
451+
364452
[[package]]
365453
name = "getrandom"
366454
version = "0.2.15"
@@ -472,6 +560,7 @@ version = "0.19.0"
472560
dependencies = [
473561
"base64 0.22.1",
474562
"bitreq",
563+
"futures",
475564
"serde",
476565
"serde_json",
477566
"socks",
@@ -959,6 +1048,12 @@ version = "1.3.0"
9591048
source = "registry+https://github.com/rust-lang/crates.io-index"
9601049
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
9611050

1051+
[[package]]
1052+
name = "slab"
1053+
version = "0.4.12"
1054+
source = "registry+https://github.com/rust-lang/crates.io-index"
1055+
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
1056+
9621057
[[package]]
9631058
name = "smallvec"
9641059
version = "1.15.1"

Cargo-recent.lock

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,94 @@ dependencies = [
361361
"percent-encoding",
362362
]
363363

364+
[[package]]
365+
name = "futures"
366+
version = "0.3.32"
367+
source = "registry+https://github.com/rust-lang/crates.io-index"
368+
checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d"
369+
dependencies = [
370+
"futures-channel",
371+
"futures-core",
372+
"futures-executor",
373+
"futures-io",
374+
"futures-sink",
375+
"futures-task",
376+
"futures-util",
377+
]
378+
379+
[[package]]
380+
name = "futures-channel"
381+
version = "0.3.32"
382+
source = "registry+https://github.com/rust-lang/crates.io-index"
383+
checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d"
384+
dependencies = [
385+
"futures-core",
386+
"futures-sink",
387+
]
388+
389+
[[package]]
390+
name = "futures-core"
391+
version = "0.3.32"
392+
source = "registry+https://github.com/rust-lang/crates.io-index"
393+
checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d"
394+
395+
[[package]]
396+
name = "futures-executor"
397+
version = "0.3.32"
398+
source = "registry+https://github.com/rust-lang/crates.io-index"
399+
checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d"
400+
dependencies = [
401+
"futures-core",
402+
"futures-task",
403+
"futures-util",
404+
]
405+
406+
[[package]]
407+
name = "futures-io"
408+
version = "0.3.32"
409+
source = "registry+https://github.com/rust-lang/crates.io-index"
410+
checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718"
411+
412+
[[package]]
413+
name = "futures-macro"
414+
version = "0.3.32"
415+
source = "registry+https://github.com/rust-lang/crates.io-index"
416+
checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b"
417+
dependencies = [
418+
"proc-macro2",
419+
"quote",
420+
"syn",
421+
]
422+
423+
[[package]]
424+
name = "futures-sink"
425+
version = "0.3.32"
426+
source = "registry+https://github.com/rust-lang/crates.io-index"
427+
checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893"
428+
429+
[[package]]
430+
name = "futures-task"
431+
version = "0.3.32"
432+
source = "registry+https://github.com/rust-lang/crates.io-index"
433+
checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393"
434+
435+
[[package]]
436+
name = "futures-util"
437+
version = "0.3.32"
438+
source = "registry+https://github.com/rust-lang/crates.io-index"
439+
checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6"
440+
dependencies = [
441+
"futures-channel",
442+
"futures-core",
443+
"futures-io",
444+
"futures-macro",
445+
"futures-sink",
446+
"futures-task",
447+
"memchr",
448+
"pin-project-lite",
449+
"slab",
450+
]
451+
364452
[[package]]
365453
name = "getrandom"
366454
version = "0.2.15"
@@ -472,6 +560,7 @@ version = "0.19.0"
472560
dependencies = [
473561
"base64 0.22.1",
474562
"bitreq",
563+
"futures",
475564
"serde",
476565
"serde_json",
477566
"socks",
@@ -959,6 +1048,12 @@ version = "1.3.0"
9591048
source = "registry+https://github.com/rust-lang/crates.io-index"
9601049
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
9611050

1051+
[[package]]
1052+
name = "slab"
1053+
version = "0.4.12"
1054+
source = "registry+https://github.com/rust-lang/crates.io-index"
1055+
checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5"
1056+
9621057
[[package]]
9631058
name = "smallvec"
9641059
version = "1.15.1"

jsonrpc/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ default = [ "simple_http", "simple_tcp" ]
2222
simple_http = [ "base64" ]
2323
# A transport that uses `bitreq` as the HTTP client.
2424
bitreq_http = [ "base64", "bitreq" ]
25+
# A transport that uses `bitreq` as the async HTTP client.
26+
bitreq_http_async = [ "base64", "bitreq", "bitreq/async", "client_async" ]
27+
# An async JSON-RPC client implementation.
28+
client_async = []
2529
# Basic transport over a raw TcpListener
2630
simple_tcp = []
2731
# Basic transport over a raw UnixStream
@@ -37,5 +41,8 @@ base64 = { version = "0.22.1", optional = true }
3741
bitreq = { version = "0.3.0", path = "../bitreq", features = ["json-using-serde"], optional = true }
3842
socks = { version = "0.3.4", optional = true}
3943

44+
[dev-dependencies]
45+
futures = "0.3"
46+
4047
[lints.rust]
4148
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(jsonrpc_fuzz)'] }

0 commit comments

Comments
 (0)