You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[cxx::bridge]mod ffi {#[dynamic_load]extern"C++"{/* as normal */fndemo(s:&str) -> u8;}}fnmain() -> Result<()>{let ffi = ffi::load("/path/to/liblibrary.so")?;let x:u8 = ffi.demo?("...");println!("{}", x);Ok(())}
where loading produces an appropriate wrapper struct around libloading::Library. Importantly, not all of the symbols may be available in the runtime version of the library, hence the ? when calling one.
Imagining something like:
where loading produces an appropriate wrapper struct around
libloading::Library
. Importantly, not all of the symbols may be available in the runtime version of the library, hence the?
when calling one.Related discussions:
The text was updated successfully, but these errors were encountered: