Line data Source code
1 : use lief_ffi as ffi;
2 :
3 : use crate::common::FromFFI;
4 : use std::marker::PhantomData;
5 : use crate::dwarf::types::DwarfType;
6 :
7 : /// This structure represents a `DW_TAG_interface_type`
8 : pub struct Interface<'a> {
9 : ptr: cxx::UniquePtr<ffi::DWARF_types_Interface>,
10 : _owner: PhantomData<&'a ()>,
11 : }
12 :
13 : impl FromFFI<ffi::DWARF_types_Interface> for Interface<'_> {
14 0 : fn from_ffi(ptr: cxx::UniquePtr<ffi::DWARF_types_Interface>) -> Self {
15 0 : Self {
16 0 : ptr,
17 0 : _owner: PhantomData,
18 0 : }
19 0 : }
20 : }
21 :
22 : impl DwarfType for Interface<'_> {
23 0 : fn get_base(&self) -> &ffi::DWARF_Type {
24 0 : self.ptr.as_ref().unwrap().as_ref()
25 0 : }
26 : }
|