pub struct ProjectContext { /* private fields */ }Expand description
Context for tracking cross-file information during transpilation.
Maintains knowledge of types, functions, and other declarations across multiple C files to enable proper reference resolution.
Implementations§
Source§impl ProjectContext
impl ProjectContext
Sourcepub fn add_transpiled_file(&mut self, file: &TranspiledFile)
pub fn add_transpiled_file(&mut self, file: &TranspiledFile)
Add a transpiled file to the context.
This makes the file’s types and functions available for cross-file reference resolution.
Sourcepub fn has_type(&self, type_name: &str) -> bool
pub fn has_type(&self, type_name: &str) -> bool
Check if a type is defined in the project context.
Sourcepub fn has_function(&self, func_name: &str) -> bool
pub fn has_function(&self, func_name: &str) -> bool
Check if a function is defined in the project context.
Sourcepub fn get_function_source(&self, func_name: &str) -> Option<&str>
pub fn get_function_source(&self, func_name: &str) -> Option<&str>
Get the source file that defines a given function.
Trait Implementations§
Source§impl Clone for ProjectContext
impl Clone for ProjectContext
Source§fn clone(&self) -> ProjectContext
fn clone(&self) -> ProjectContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProjectContext
impl Debug for ProjectContext
Source§impl Default for ProjectContext
impl Default for ProjectContext
Source§fn default() -> ProjectContext
fn default() -> ProjectContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ProjectContext
impl RefUnwindSafe for ProjectContext
impl Send for ProjectContext
impl Sync for ProjectContext
impl Unpin for ProjectContext
impl UnsafeUnpin for ProjectContext
impl UnwindSafe for ProjectContext
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