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
38
39
40
41
//! RAII wrappers around `rnp_input_t` and `rnp_output_t`.
//!
//! Every byte-stream that crosses the Rust/C boundary in this crate goes
//! through [`Input`] or [`Output`]. They own the underlying handle and free
//! it on `Drop`, even on error paths reached via `?`. This eliminates the
//! bespoke cleanup functions that previously appeared in `signature.rs` and
//! the duplicated `drain_memory_output` helpers in `key.rs` /
//! `signature.rs`.
//!
//! The C-string / buffer-destroy helpers live in [`crate::ffi_safe`]; this
//! module re-exports them for backward compatibility with callers that
//! import from `crate::ops::*`.
//!
//! ## Listener model
//!
//! Callback-based inputs and outputs are deferred to a later phase (they
//! require careful lifetime design around boxed trait objects). Memory, path,
//! stdin/stdout, file, null, and armor destinations are all supported here.
//!
//! ## Module layout
//!
//! | Sub-module | Concern |
//! |---------------|--------------------------------------------------------|
//! | `input` | `Input` RAII |
//! | `output` | `Output` RAII + `OutputFileFlags` |
//! | `armor_type` | `ArmorType` enum |
// C-string / buffer return helpers — defined in [`crate::ffi_safe`].
// Re-exported here for compatibility with existing callers that import from
// `crate::ops::*`. New code should import directly from `crate::ffi_safe`.
pub use crate;
pub use ArmorType;
pub use Input;
pub use ;