-
Notifications
You must be signed in to change notification settings - Fork 88
feat: add BorshSerializeAsync/BorshDeserializeAsync (WIP)
#337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
DanikVitek
wants to merge
74
commits into
near:master
Choose a base branch
from
DanikVitek:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 69 commits
Commits
Show all changes
74 commits
Select commit
Hold shift + click to select a range
d4d92f7
WIP: implement support for async I/O. FIXME: resolve issue with type …
DanikVitek 23a292f
resolved issue with type parameters needing `Send` bound
DanikVitek 5b7f19d
remove redundant `cfg_attr`s
DanikVitek cf2807c
Implement async I/O for all standard types. TODO: derive, etc.
DanikVitek 447d7bb
remove `async-generic` version
DanikVitek 984b16d
Merge remote-tracking branch 'upstream/master'
DanikVitek 31a4c24
Remove dependency on sync counterparts
DanikVitek d484aa4
use `impl Future` for async traits
DanikVitek a2526e2
Implement async traits, using `impl Future`
DanikVitek ecdbd3c
inline inner `as_bytes` fns; use `write_u32` for `len`
DanikVitek 037bc31
Update workflow Rust version
DanikVitek e5216c5
Formatting & remove redundant imports
DanikVitek bb3d210
Rollback remove unused imports. Add `#[allow(unused_imports)]`
DanikVitek 7dacd4c
Add support for mutex/rwlock (de-)serialization (including async coun…
DanikVitek e322cb5
Fix docs
DanikVitek 6e250a5
set patch `syn` version
DanikVitek 0d0d550
Manually declare async trait variants. Update `async_generic` usage
DanikVitek a677a17
Fix formatting in macros
DanikVitek 48f7d09
Fixate `async-generic` commit version
DanikVitek d2ea430
Fixate `async-generic` commit version
DanikVitek 0c85a18
Box errors instead of strings
DanikVitek 09735b2
Remove support locks and unnecessary trait bounds
DanikVitek f9aed6b
Remove unnecessary trait bounds
DanikVitek ae05c33
Remove wrong `#[cfg]`
DanikVitek c57e5e6
use `cfg!` for io error creation
DanikVitek 5da74f3
move private `fn _new` into `pub fn new`
DanikVitek 22bb75b
Fix `async-generic` revision specification
DanikVitek dc317ad
Partial revert
DanikVitek 8ff7681
replace `cfg!` with `#[cfg]`
DanikVitek 97febbe
move `ToString` import
DanikVitek a34c3e5
Fix macros formatting issues
DanikVitek b7f7fec
use `crate::io::Result`
DanikVitek 43bec58
WIP: implement derive macro for async traits
DanikVitek d64ff6b
Rename async-related features
DanikVitek 22b2bde
use `Cow<'static, str>` in place of `String` to reduce cloning
DanikVitek c142a0f
Merge pull request #2 from DanikVitek/master
DanikVitek b98e23d
formatting
DanikVitek 7358d3a
Merge pull request #3 from DanikVitek/master
DanikVitek a48e9fa
add `pub use` for derive macros for async traits
DanikVitek 2891864
Code cleanup. Reduce `quote!` usage where unnecessary. WIP: update de…
DanikVitek 42fd2b2
Add compilation tests
DanikVitek 8001084
Add default `read_exact` impl. Fix doc test
DanikVitek 2d1c059
Merge pull request #4 from DanikVitek/master
DanikVitek 4e04e09
Fix doc tests
DanikVitek e13e6ef
Add tests. Use `write_u8` for `variant_idx` in `BorshSerializeAsync` …
DanikVitek 6c78116
fmt
DanikVitek a13066c
Merge pull request #1 from DanikVitek/async/derive
DanikVitek 475a6ce
Revert rustfmt.toml
DanikVitek 8419d81
Parametrize `needs_bounds_derive` and `collect_bounds` with `IS_ASYNC`
DanikVitek 92316bd
Fix doc tests
DanikVitek 1b663e2
Add description for the `unstable__async`, `unstable__tokio` and `uns…
DanikVitek fb1e01d
guard async-related code under the `async` feature flag
DanikVitek f842c46
add docs on IO
DanikVitek a729695
Fix tests in CI
DanikVitek 49cf096
Fix benchmarks features
DanikVitek b669baf
Fix clippy warnings
DanikVitek c5b99e5
fmt
DanikVitek 9f4c5e3
Fix doc links
DanikVitek f23ed33
Use monospace for types and features
DanikVitek 57a0a40
Fix tests
DanikVitek 584f36f
Revert changes
DanikVitek bc70f92
Add docs to the `async_io` declaration
DanikVitek a5e027e
Fix lifetimes
DanikVitek 018c356
fmt
DanikVitek 19e1571
Fix clippy & fmt warnings
DanikVitek 66447cb
Fix docs and doc tests
DanikVitek 7c3eb77
Fix docs and checks in CI. Fix clippy warnings about mixed attributes…
DanikVitek 0a1aab4
Readability fixes. Add test for async array deserialization
DanikVitek d624435
Readability fix
DanikVitek 6c52ef9
Fix lifetimes. Add `ascii` feature to docs metadata
DanikVitek da103d3
clippy
DanikVitek 253b868
fmt
DanikVitek e58f2b9
make `captures` module public
DanikVitek 611e8b7
revert remove `inline`
DanikVitek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,9 @@ | ||
| [workspace] | ||
| resolver = "2" | ||
| members = ["borsh", "borsh-derive", "fuzz/fuzz-run", "benchmarks"] | ||
|
|
||
| [workspace.package] | ||
| # shared version of all public crates in the workspace | ||
| version = "1.5.5" | ||
| rust-version = "1.67.0" | ||
| edition = "2021" | ||
| rust-version = "1.75.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ name = "benchmarks" | |
| version.workspace = true | ||
| rust-version.workspace = true | ||
| authors = ["Near Inc <[email protected]>"] | ||
| edition = "2018" | ||
| edition.workspace = true | ||
| publish = false | ||
|
|
||
| # This is somehow needed for command line arguments to work: https://github.com/bheisler/criterion.rs/issues/193#issuecomment-415740713 | ||
|
|
@@ -13,7 +13,7 @@ bench = false | |
| [dependencies] | ||
| rand_xorshift = "0.2.0" | ||
| rand = "0.7.0" | ||
| borsh = { path = "../borsh", default-features = false } | ||
| borsh = { path = "../borsh", default-features = false, features = ["std", "derive"] } | ||
| serde = { version = "1.0", features = ["derive"] } | ||
| speedy-derive = "0.5" | ||
| speedy = "0.5" | ||
|
|
@@ -39,6 +39,3 @@ harness = false | |
| [[bench]] | ||
| name = "object_length" | ||
| harness = false | ||
|
|
||
| [features] | ||
| default = ["borsh/std", "borsh/derive"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.