-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from polywrap/develop
Release 0.2.3
- Loading branch information
Showing
45 changed files
with
6,004 additions
and
93 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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 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 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
29 changes: 29 additions & 0 deletions
29
examples/http-server-app/src/wrap/imported/multipart_file_info/mod.rs
This file contains 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use serde::{Serialize, Deserialize}; | ||
use polywrap_msgpack_serde::{ | ||
wrappers::polywrap_json::JSONString, | ||
wrappers::polywrap_bigint::BigIntWrapper | ||
}; | ||
use polywrap_wasm_rs::{ | ||
BigInt, | ||
BigNumber, | ||
Map, | ||
JSON | ||
}; | ||
use serde_bytes::ByteBuf; | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize)] | ||
pub struct MultipartFileInfo { | ||
pub name: String, | ||
pub content: ByteBuf, | ||
} | ||
|
||
impl MultipartFileInfo { | ||
pub const URI: &'static str = "wrap://http/http.wrappers.dev/u/test/multipart"; | ||
|
||
pub fn new() -> MultipartFileInfo { | ||
MultipartFileInfo { | ||
name: String::new(), | ||
content: ByteBuf::from(vec![]), | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
examples/http-server-app/src/wrap/imported/multipart_key_value_pair/mod.rs
This file contains 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use serde::{Serialize, Deserialize}; | ||
use polywrap_msgpack_serde::{ | ||
wrappers::polywrap_json::JSONString, | ||
wrappers::polywrap_bigint::BigIntWrapper | ||
}; | ||
use polywrap_wasm_rs::{ | ||
BigInt, | ||
BigNumber, | ||
Map, | ||
JSON | ||
}; | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize)] | ||
pub struct MultipartKeyValuePair { | ||
pub key: String, | ||
pub value: String, | ||
} | ||
|
||
impl MultipartKeyValuePair { | ||
pub const URI: &'static str = "wrap://http/http.wrappers.dev/u/test/multipart"; | ||
|
||
pub fn new() -> MultipartKeyValuePair { | ||
MultipartKeyValuePair { | ||
key: String::new(), | ||
value: String::new(), | ||
} | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
examples/http-server-app/src/wrap/imported/multipart_module/mod.rs
This file contains 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
use serde::{Serialize, Deserialize}; | ||
use polywrap_msgpack_serde::{ | ||
from_slice, | ||
to_vec, | ||
wrappers::polywrap_json::JSONString, | ||
wrappers::polywrap_bigint::BigIntWrapper | ||
}; | ||
use polywrap_wasm_rs::{ | ||
BigInt, | ||
BigNumber, | ||
Map, | ||
JSON, | ||
subinvoke | ||
}; | ||
use serde_bytes::ByteBuf; | ||
use crate::MultipartKeyValuePair; | ||
use crate::MultipartFileInfo; | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize)] | ||
pub struct ArgsGetFiles { | ||
pub headers: Vec<MultipartKeyValuePair>, | ||
pub body: ByteBuf, | ||
} | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize)] | ||
pub struct MultipartModule {} | ||
|
||
impl MultipartModule { | ||
pub const URI: &'static str = "wrap://http/http.wrappers.dev/u/test/multipart"; | ||
|
||
pub fn new() -> MultipartModule { | ||
MultipartModule {} | ||
} | ||
|
||
pub fn get_files(args: &ArgsGetFiles) -> Result<Vec<MultipartFileInfo>, String> { | ||
let uri = MultipartModule::URI; | ||
let args = to_vec(args).map_err(|e| e.to_string())?; | ||
let result = subinvoke::wrap_subinvoke( | ||
uri, | ||
"getFiles", | ||
args, | ||
)?; | ||
from_slice(result.as_slice()).map_err(|e| e.to_string()) | ||
} | ||
} |
This file contains 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 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 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.