feat: finish cdylib ffi and improve ffi C header
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user