这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
623 changes: 361 additions & 262 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ name = "wws"
path = "src/main.rs"

[dependencies]
wasmtime = "4.0.0"
wasmtime-wasi = "4.0.0"
wasmtime = "5.0.0"
wasmtime-wasi = "5.0.0"
anyhow = "1.0.66"
blake3 = "1.3.3"
wasi-common = "4.0.0"
wasi-common = "5.0.0"
actix-web = "4"
actix-files = "0.6.2"
lazy_static = "1.4.0"
env_logger = "0.9.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.85"
wax = "0.5.0"
toml = "0.6.0"
base64 = "0.13.1"
toml = "0.7.0"
base64 = "0.21.0"
clap = { version = "4.0.10", features = ["derive"] }
regex = "1"
url = "2.3.1"
Expand Down
9 changes: 7 additions & 2 deletions examples/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: all rust-*
.PHONY: all rust-* pdf-create

rust-basic:
cd rust-basic && \
Expand All @@ -15,4 +15,9 @@ rust-params:
cargo build --target wasm32-wasi --release && \
mv target/wasm32-wasi/release/rust-params.wasm "./[id].wasm"

all: rust-basic rust-kv
pdf-create:
cd pdf-create && \
cargo build --target wasm32-wasi --release && \
mv target/wasm32-wasi/release/pdf-create.wasm ./index.wasm

all: rust-basic rust-kv rust-params pdf-create
4 changes: 2 additions & 2 deletions examples/pdf-create/Cargo.lock

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

4 changes: 2 additions & 2 deletions examples/rust-basic/Cargo.lock

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

4 changes: 2 additions & 2 deletions examples/rust-kv/Cargo.lock

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

4 changes: 2 additions & 2 deletions examples/rust-params/Cargo.lock

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

2 changes: 1 addition & 1 deletion kits/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ http = "0.2.8"
worker = { path = "./worker" }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.85"
base64 = "0.13.1"
base64 = "0.21.0"
4 changes: 2 additions & 2 deletions kits/rust/src/content.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use base64::encode;
use base64::{engine::general_purpose, Engine as _};

/// Identifies the content of a response. In other words, the body.
/// We need this intermediate entity in Rust to be able to expose
Expand All @@ -17,7 +17,7 @@ pub enum Content {

impl From<Vec<u8>> for Content {
fn from(s: Vec<u8>) -> Content {
Content::Base64(encode(s))
Content::Base64(general_purpose::STANDARD.encode(s))
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/workers/wasm_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use actix_web::{
HttpRequest,
};
use anyhow::Result;
use base64::decode;
use base64::{engine::general_purpose, Engine as _};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

Expand Down Expand Up @@ -121,7 +121,7 @@ impl WasmOutput {
/// decode the data if the base64 flag is enabled.
pub fn body(&self) -> Result<Vec<u8>> {
if self.base64 {
Ok(decode(&self.data)?)
Ok(general_purpose::STANDARD.decode(&self.data)?)
} else {
Ok(self.data.as_bytes().into())
}
Expand Down