bitcoinkernel/ffi/
mod.rs

1pub mod c_helpers;
2pub mod constants;
3
4pub(crate) mod sealed {
5    pub trait AsPtr<T> {
6        /// Returns a raw pointer to the underlying C object.
7        fn as_ptr(&self) -> *const T;
8    }
9
10    pub trait FromPtr<T> {
11        /// Creates a wrapper from a raw const C pointer.
12        unsafe fn from_ptr(ptr: *const T) -> Self;
13    }
14
15    pub trait FromMutPtr<T> {
16        /// Creates a wrapper from a raw mutable C pointer.
17        unsafe fn from_ptr(ptr: *mut T) -> Self;
18    }
19}
20
21pub use c_helpers::{enabled, present, success, to_c_bool, to_c_result, to_string};
22pub(crate) use constants::*;