Skip to content

Commit

Permalink
update Cargo.lock
Browse files Browse the repository at this point in the history
  • Loading branch information
littledivy committed Nov 15, 2021
1 parent d73fe94 commit ef316ca
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 58 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

112 changes: 56 additions & 56 deletions example/bindings/bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,56 @@ const opts = {
policy: CachePolicy.NONE,
}
const _lib = await prepare(opts, {
test_lifetime: {
add: { parameters: ["i32", "i32"], result: "i32", nonblocking: false },
test_buf: {
parameters: ["buffer", "usize"],
result: "usize",
result: "u8",
nonblocking: false,
},
test_mixed_order: {
parameters: ["i32", "buffer", "usize", "i32"],
result: "i32",
nonblocking: false,
},
add2: { parameters: ["buffer", "usize"], result: "i32", nonblocking: false },
sleep: { parameters: ["u64"], result: "void", nonblocking: true },
test_str: {
parameters: ["buffer", "usize"],
result: "void",
nonblocking: false,
},
test_mut_buf: {
parameters: ["buffer", "usize"],
result: "void",
nonblocking: false,
},
test_tag_and_content: {
test_serde: {
parameters: ["buffer", "usize"],
result: "i32",
result: "u8",
nonblocking: false,
},
test_serde: {
test_lifetime: {
parameters: ["buffer", "usize"],
result: "u8",
result: "usize",
nonblocking: false,
},
test_mixed: {
parameters: ["isize", "buffer", "usize"],
result: "i32",
nonblocking: false,
},
add: { parameters: ["i32", "i32"], result: "i32", nonblocking: false },
test_buf: {
sleep: { parameters: ["u64"], result: "void", nonblocking: true },
add2: { parameters: ["buffer", "usize"], result: "i32", nonblocking: false },
test_tag_and_content: {
parameters: ["buffer", "usize"],
result: "u8",
result: "i32",
nonblocking: false,
},
test_mut_buf: {
parameters: ["buffer", "usize"],
result: "void",
nonblocking: false,
},
})
export type TagAndContent =
| { key: "A"; value: { b: number } }
| { key: "C"; value: { d: number } }
export type MyStruct = {
arr: Array<string>
}
/**
* Doc comment for `Input` struct.
* ...testing multiline
Expand All @@ -67,8 +73,19 @@ export type Input = {
a: number
b: number
}
export type MyStruct = {
arr: Array<string>
export type TestLifetimeWrap = {
_a: TestLifetimeEnums
}
export type OptionStruct = {
maybe: string | undefined | null
}
export type TestLifetimes = {
text: string
}
export type TestLifetimeEnums = {
Text: {
_text: string
}
}
export type PlainEnum =
| {
Expand All @@ -78,26 +95,12 @@ export type PlainEnum =
}
| "b"
| "c"
export type TestLifetimeEnums = {
Text: {
_text: string
}
}
export type OptionStruct = {
maybe: string | undefined | null
}
export type TestLifetimeWrap = {
_a: TestLifetimeEnums
}
export type TestLifetimes = {
text: string
export function add(a0: number, a1: number) {
return _lib.symbols.add(a0, a1) as number
}
export type TagAndContent =
| { key: "A"; value: { b: number } }
| { key: "C"; value: { d: number } }
export function test_lifetime(a0: TestLifetimes) {
const a0_buf = encode(JSON.stringify(a0))
return _lib.symbols.test_lifetime(a0_buf, a0_buf.byteLength) as number
export function test_buf(a0: Uint8Array) {
const a0_buf = encode(a0)
return _lib.symbols.test_buf(a0_buf, a0_buf.byteLength) as number
}
export function test_mixed_order(a0: number, a1: Input, a2: number) {
const a1_buf = encode(JSON.stringify(a1))
Expand All @@ -108,37 +111,34 @@ export function test_mixed_order(a0: number, a1: Input, a2: number) {
a2,
) as number
}
export function add2(a0: Input) {
const a0_buf = encode(JSON.stringify(a0))
return _lib.symbols.add2(a0_buf, a0_buf.byteLength) as number
}
export function sleep(a0: number) {
return _lib.symbols.sleep(a0) as Promise<null>
}
export function test_str(a0: string) {
const a0_buf = encode(a0)
return _lib.symbols.test_str(a0_buf, a0_buf.byteLength) as null
}
export function test_mut_buf(a0: Uint8Array) {
const a0_buf = encode(a0)
return _lib.symbols.test_mut_buf(a0_buf, a0_buf.byteLength) as null
}
export function test_tag_and_content(a0: TagAndContent) {
const a0_buf = encode(JSON.stringify(a0))
return _lib.symbols.test_tag_and_content(a0_buf, a0_buf.byteLength) as number
}
export function test_serde(a0: MyStruct) {
const a0_buf = encode(JSON.stringify(a0))
return _lib.symbols.test_serde(a0_buf, a0_buf.byteLength) as number
}
export function test_lifetime(a0: TestLifetimes) {
const a0_buf = encode(JSON.stringify(a0))
return _lib.symbols.test_lifetime(a0_buf, a0_buf.byteLength) as number
}
export function test_mixed(a0: number, a1: Input) {
const a1_buf = encode(JSON.stringify(a1))
return _lib.symbols.test_mixed(a0, a1_buf, a1_buf.byteLength) as number
}
export function add(a0: number, a1: number) {
return _lib.symbols.add(a0, a1) as number
export function sleep(a0: number) {
return _lib.symbols.sleep(a0) as Promise<null>
}
export function test_buf(a0: Uint8Array) {
export function add2(a0: Input) {
const a0_buf = encode(JSON.stringify(a0))
return _lib.symbols.add2(a0_buf, a0_buf.byteLength) as number
}
export function test_tag_and_content(a0: TagAndContent) {
const a0_buf = encode(JSON.stringify(a0))
return _lib.symbols.test_tag_and_content(a0_buf, a0_buf.byteLength) as number
}
export function test_mut_buf(a0: Uint8Array) {
const a0_buf = encode(a0)
return _lib.symbols.test_buf(a0_buf, a0_buf.byteLength) as number
return _lib.symbols.test_mut_buf(a0_buf, a0_buf.byteLength) as null
}
6 changes: 6 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cd deno_bindgen_macro && cargo publish
# wait for crates.io to update
sleep 2
cargo publish
# update lockfile
make test

0 comments on commit ef316ca

Please sign in to comment.