async thru dylib

This commit is contained in:
Andy Killorin 2024-12-18 23:22:35 -05:00
commit bf8a1ad8ed
Signed by: ank
GPG key ID: 23F9463ECB67FE8C

14
loaded/src/lib.rs Normal file
View 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 {
}