| Crates.io | ffi-result |
| lib.rs | ffi-result |
| version | 0.1.0 |
| created_at | 2025-05-17 19:31:08.416986+00 |
| updated_at | 2025-05-17 19:31:08.416986+00 |
| description | FFI-compatibe and ABI-stable analogue for core::result::Result. |
| homepage | |
| repository | https://github.com/USSURATONCACHI/ffi-result |
| max_upload_size | |
| id | 1678100 |
| size | 10,537 |
FFI-compatibe and ABI-stable analogue for core::result::Result<T, E>.
This result is used the same way as the regular Result<T, E>. It can be freely converted to and from a regular Result<T, E>.
It is meant to use in ffi functions.
#[unsafe(no_mangle)]
pub unsafe extern "C" fn example_function(data: std::ffi::CString) -> ffi_result::Result<i32, std::ffi::CString> {
if todo!() {
Ok(123).into()
} else {
Err(data).into()
}
}