1
0

feat: finish cdylib ffi and improve ffi C header

This commit is contained in:
2026-05-18 13:33:57 +08:00
parent f1a7cb89e5
commit 91c7fdda70
6 changed files with 164 additions and 143 deletions

View File

@@ -17,6 +17,14 @@ pub enum Error {
/// The token for fetching object in [ObjectPool].
pub type Token = u64;
/// Get the invalid token.
///
/// Invalid token is always invalid for fetching object in pool,
/// And can be useful in FFI scenario.
pub fn invalid_token() -> Token {
DefaultKey::null().data().as_ffi()
}
/// A pool for managing objects with unique tokens.
///
/// It is highly suggested to use this pool with [std::sync::RwLock] guard.