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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//! Collection of all FFI items a library wants to expose.
//!
//! The main entry point is [`RustInventory`], built with a builder pattern and the
//! registration macros [`function!`](crate::function), [`service!`](crate::service), [`constant!`](crate::constant), and [`extra_type!`](crate::extra_type).
//! Types referenced by registered functions and services are discovered automatically.
//!
//! ```rust
//! use interoptopus::{ffi, function, service, constant};
//! use interoptopus::inventory::RustInventory;
//!
//! # #[ffi] pub enum MyError { General }
//! # #[ffi] pub fn foo(a: u32, b: u32) -> u32 { a + b }
//! # #[ffi] pub const MAX: u32 = 100;
//! # #[ffi(service)] pub struct Service { v: u32 }
//! # #[ffi] impl Service {
//! # pub fn create() -> ffi::Result<Self, MyError> { ffi::Ok(Self { v: 0 }) }
//! # }
//! pub fn ffi_inventory() -> RustInventory {
//! RustInventory::new()
//! .register(function!(foo))
//! .register(constant!(MAX))
//! .register(service!(Service))
//! .validate()
//! }
//! ```
use crateConstant;
use crateFunction;
use crateService;
use crateType;
use BTreeMap;
pub use ;
pub use PluginInventory;
pub use RustInventory;
/// All registered types.
pub type Types = ;
/// All registered functions.
pub type Functions = ;
/// All registered constants.
pub type Constants = ;
/// All registered services.
pub type Services = ;
/// Trait implemented by inventory types that can accept FFI item registrations.
///
/// You typically don't need to use this directly — the registration macros
/// ([`function`](crate::function!), [`service`](crate::service!), etc.) call these methods for you.