diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-01-23 17:27:06 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-01-25 14:04:26 +0100 |
commit | 71ea3a7f02cc59c5e891c25edbe270e2d9d9d71d (patch) | |
tree | f518a31f491e6f6816b4014bbe7bc9768bfdc20d /ffi | |
parent | d1e68e97496d0541f3ddd0483f62e185e870c9e4 (diff) |
openpgp-ffi: Derive conversion functions.
- This is a framework for dealing with ownership and references at
the FFI boundary. Previously, we used macros to do that. This
change introduces a more idiomatic interface, we use traits
converting from raw pointers of a wrapper type to objects,
references, or mutable references to a wrapped type.
- For now, we use the wrapped type as wrapper type. We merely
introduce a new mechanism replacing the macro-based one.
- This patch also converts all the derived functions.
- The following patches will convert all the functions that are
already using the ffi_wrapper_type. Once this conversion is done,
we can introduce our own wrapper type.
Diffstat (limited to 'ffi')
-rw-r--r-- | ffi/src/lib.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ffi/src/lib.rs b/ffi/src/lib.rs index f183f9cc..9b095cd3 100644 --- a/ffi/src/lib.rs +++ b/ffi/src/lib.rs @@ -131,6 +131,12 @@ pub mod openpgp { pub(crate) use openpgp::{ build_hasher, strndup, + MoveFromRaw, + RefRaw, + RefMutRaw, + MoveIntoRaw, + MoveResultIntoRaw, + Maybe, }; /* Error handling with implicit context. */ |