forked from bytecodealliance/wit-bindgen
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more stream prototype implementation
- Loading branch information
Showing
9 changed files
with
50 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ version = "0.1.0" | |
edition = "2021" | ||
|
||
[dependencies] | ||
stream = { version = "0.1.0", path = "../stream" } |
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,9 @@ | ||
use std::env; | ||
|
||
fn main() { | ||
let out = env::var_os("OUT_DIR").unwrap(); | ||
println!( | ||
r"cargo:rustc-link-search={}/../../../deps", | ||
out.into_string().unwrap() | ||
); | ||
} |
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 |
---|---|---|
@@ -1,3 +1,15 @@ | ||
// use wit_bindgen_symmetric_rt::{CallbackState, EventSubscription}; | ||
|
||
#[link(name = "stream")] | ||
extern "C" { | ||
pub fn testX3AtestX2Fstream_testX00X5BasyncX5Dcreate( | ||
args: *const (), | ||
results: *mut (), | ||
) -> *mut (); | ||
} | ||
|
||
fn main() { | ||
println!("Hello, world!"); | ||
let mut result_stream: *mut () = core::ptr::null_mut(); | ||
let handle = unsafe { testX3AtestX2Fstream_testX00X5BasyncX5Dcreate(core::ptr::null_mut(), (&mut result_stream as *mut *mut ()).cast()) }; | ||
assert!(handle.is_null()); | ||
} |
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 |
---|---|---|
|
@@ -4,3 +4,6 @@ version = "0.1.0" | |
edition = "2021" | ||
|
||
[dependencies] | ||
|
||
[lib] | ||
crate-type = ["cdylib"] |
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 |
---|---|---|
@@ -1,14 +1,6 @@ | ||
pub fn add(left: u64, right: u64) -> u64 { | ||
left + right | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::*; | ||
#[allow(non_snake_case)] | ||
|
||
#[test] | ||
fn it_works() { | ||
let result = add(2, 2); | ||
assert_eq!(result, 4); | ||
} | ||
#[no_mangle] | ||
pub fn testX3AtestX2Fstream_sourceX00X5BasyncX5Dcreate(_args:*mut u8, _results:*mut u8) -> *mut u8 { | ||
todo!() | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
use std::env; | ||
|
||
fn main() { | ||
let out = env::var_os("OUT_DIR").unwrap(); | ||
println!( | ||
r"cargo:rustc-link-search={}/../../../deps", | ||
out.into_string().unwrap() | ||
); | ||
} |
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