Skip to content

Commit

Permalink
Using BincodeSerializer as BinarySerializer (#178)
Browse files Browse the repository at this point in the history
* Replacing bincode with vbs::Serializer
* Making App and Api versioned
  • Loading branch information
nyospe authored Mar 1, 2024
1 parent b86715f commit 1f8515b
Show file tree
Hide file tree
Showing 11 changed files with 334 additions and 192 deletions.
28 changes: 26 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tide-disco"
version = "0.4.6"
version = "0.4.7"
edition = "2021"
authors = ["Espresso Systems <[email protected]>"]
description = "Discoverability for Tide"
Expand All @@ -12,9 +12,9 @@ name = "hello-world"
test = true

[dependencies]
anyhow = "1.0"
async-std = { version = "1.8.0", features = ["attributes"] }
async-trait = "0.1.74"
bincode = "1.3.3"
clap = { version = "4.5", features = ["derive"] }
config = "0.13.4"
derivative = "2.2"
Expand Down Expand Up @@ -54,6 +54,7 @@ tracing-futures = "0.2"
tracing-log = "0.2.0"
tracing-subscriber = { version = "0.3.18", features = ["env-filter", "json"] }
url = "2.5.0"
versioned-binary-serialization = { git = "https://github.com/EspressoSystems/versioned-binary-serialization.git", tag = "0.1.0" }

[target.'cfg(not(windows))'.dependencies]
signal-hook-async-std = "0.2.2"
Expand Down
5 changes: 3 additions & 2 deletions examples/hello-world/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,12 @@ impl From<RequestError> for HelloError {
}

async fn serve(port: u16) -> io::Result<()> {
let mut app = App::<_, HelloError>::with_state(RwLock::new("Hello".to_string()));
let mut app = App::<_, HelloError, 0, 1>::with_state(RwLock::new("Hello".to_string()));
app.with_version(env!("CARGO_PKG_VERSION").parse().unwrap());

let mut api =
Api::<RwLock<String>, HelloError>::from_file("examples/hello-world/api.toml").unwrap();
Api::<RwLock<String>, HelloError, 0, 1>::from_file("examples/hello-world/api.toml")
.unwrap();
api.with_version(env!("CARGO_PKG_VERSION").parse().unwrap());

// Can invoke by browsing
Expand Down
Loading

0 comments on commit 1f8515b

Please sign in to comment.