pub struct HeaderCache {
pub safety_annotations: HashMap<String, SafetyMode>,
pub external_annotations: ExternalAnnotations,
/* private fields */
}Expand description
Cache for storing function signatures from header files
Fields§
§safety_annotations: HashMap<String, SafetyMode>Map from function name to its safety annotation from header
external_annotations: ExternalAnnotationsExternal annotations found in headers
Implementations§
Source§impl HeaderCache
impl HeaderCache
pub fn new() -> Self
Sourcepub fn set_include_paths(&mut self, paths: Vec<PathBuf>)
pub fn set_include_paths(&mut self, paths: Vec<PathBuf>)
Set the include paths for header file resolution
Sourcepub fn get_signature(&self, func_name: &str) -> Option<&FunctionSignature>
pub fn get_signature(&self, func_name: &str) -> Option<&FunctionSignature>
Get a function signature by name
Sourcepub fn get_safety_annotation(&self, func_name: &str) -> Option<SafetyMode>
pub fn get_safety_annotation(&self, func_name: &str) -> Option<SafetyMode>
Get safety annotation for a function from headers
Sourcepub fn parse_header(&mut self, header_path: &Path) -> Result<(), String>
pub fn parse_header(&mut self, header_path: &Path) -> Result<(), String>
Parse a header file and extract all annotated function signatures
Sourcepub fn parse_includes_from_source(
&mut self,
cpp_file: &Path,
) -> Result<(), String>
pub fn parse_includes_from_source( &mut self, cpp_file: &Path, ) -> Result<(), String>
Parse headers from a C++ source file’s includes
Sourcepub fn has_signatures(&self) -> bool
pub fn has_signatures(&self) -> bool
Check if any signatures are cached
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HeaderCache
impl RefUnwindSafe for HeaderCache
impl Send for HeaderCache
impl Sync for HeaderCache
impl Unpin for HeaderCache
impl UnwindSafe for HeaderCache
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