Struct interoptopus::Inventory
source ยท pub struct Inventory { /* private fields */ }
Expand description
Represents all FFI-relevant items, produced via InventoryBuilder
, ingested by backends.
Implementationsยง
sourceยงimpl Inventory
impl Inventory
sourcepub fn ctypes(&self) -> &[CType]
pub fn ctypes(&self) -> &[CType]
Returns all found types; this includes types directly used in fields and parameters, and all their recursive constitutents.
sourcepub fn namespaces(&self) -> &[String]
pub fn namespaces(&self) -> &[String]
Return all known namespaces.
sourcepub fn patterns(&self) -> &[LibraryPattern]
pub fn patterns(&self) -> &[LibraryPattern]
Return all registered LibraryPattern
. In contrast, TypePattern
will be found inside the types returned via ctypes()
.
sourcepub fn filter<P: FnMut(InventoryItem<'_>) -> bool>(
&self,
predicate: P
) -> Inventory
pub fn filter<P: FnMut(InventoryItem<'_>) -> bool>( &self, predicate: P ) -> Inventory
Return a new Inventory
filtering items by a predicate.
Useful for removing duplicate symbols when generating bindings split across multiple files.
ยงExamples
Here we filter an inventory, keeping only types, removing all other items.
let filtered = inventory.filter(|x| {
match x {
InventoryItem::CType(_) => true,
_ => false,
}
});
Trait Implementationsยง
sourceยงimpl From<Inventory> for APIVersion
impl From<Inventory> for APIVersion
sourceยงimpl PartialEq for Inventory
impl PartialEq for Inventory
sourceยงimpl PartialOrd for Inventory
impl PartialOrd for Inventory
1.0.0 ยท sourceยงfn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl StructuralPartialEq for Inventory
Auto Trait Implementationsยง
impl RefUnwindSafe for Inventory
impl Send for Inventory
impl Sync for Inventory
impl Unpin for Inventory
impl UnwindSafe for Inventory
Blanket Implementationsยง
sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more