1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Callback installation for [`Context`](crate::Context).
//!
//! All callback plumbing — trait definitions, holder types, C thunks, and the
//! registry that owns the holders — lives in this directory module.
//! [`Context`] delegates to [`Callbacks`] via thin `set_*` methods.
//!
//! ## Borrowed view
//!
//! The C-side key-provider thunk receives a raw `rnp_ffi_t` from librnp.
//! To give the user's trait implementation a usable `&Context`, the thunk
//! constructs a transient view via [`ContextBorrow`] (a `ManuallyDrop`-
//! backed wrapper that does **not** destroy the ffi). This avoids the
//! older `borrowed: bool` flag on `Context` itself — ownership semantics
//! are expressed in the type, not in runtime state.
//!
//! ## Module layout
//!
//! | Sub-module | Concern |
//! |-------------|--------------------------------------------------------|
//! | `traits` | `PasswordProvider` + `KeyProvider` traits |
//! | `types` | `RequestedKeyType` + `KeyRequestOutcome` enums |
//! | `registry` | `Callbacks` + `PasswordHolder` + `KeyProviderHolder` |
//! | `thunks` | `password_thunk` + `key_provider_thunk` + `ContextBorrow` |
//! | `logging` | `Context::set_log_fd`/`set_log_file` (feature-gated) |
pub use Callbacks;
pub use ContextBorrow;
pub use ;
pub use ;