async thru dylib
This commit is contained in:
commit
bf8a1ad8ed
1 changed files with 417 additions and 0 deletions
14
loaded/src/lib.rs
Normal file
14
loaded/src/lib.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use std::{future::Future, pin::Pin};
|
||||
|
||||
pub async fn add(left: u64, right: u64) -> u64 {
|
||||
left + right
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub fn add_wrapper(left: u64, right: u64) -> Pin<Box<dyn Future<Output = u64>>> {
|
||||
Box::pin(add(left,right))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
}
|
||||
Loading…
Reference in a new issue