pub struct CDecisionContext {
pub c_construct: CConstruct,
pub category: CDecisionCategory,
pub c_span: Option<SourceSpan>,
pub rust_span: Option<SourceSpan>,
pub c_context: String,
pub hir_hash: u64,
}Expand description
Context for C→Rust transpilation decisions
Fields§
§c_construct: CConstructOriginal C construct (pointer, array, etc.)
category: CDecisionCategoryDecision category
c_span: Option<SourceSpan>Source location in C
rust_span: Option<SourceSpan>Target location in generated Rust
c_context: StringSurrounding C code for pattern matching
hir_hash: u64HIR node hash for deduplication
Implementations§
Source§impl CDecisionContext
impl CDecisionContext
Sourcepub fn new(construct: CConstruct, category: CDecisionCategory) -> Self
pub fn new(construct: CConstruct, category: CDecisionCategory) -> Self
Create a new context
Sourcepub fn with_c_span(self, span: SourceSpan) -> Self
pub fn with_c_span(self, span: SourceSpan) -> Self
Add C source span
Sourcepub fn with_context(self, context: impl Into<String>) -> Self
pub fn with_context(self, context: impl Into<String>) -> Self
Add surrounding context
Sourcepub fn to_context_strings(&self) -> Vec<String>
pub fn to_context_strings(&self) -> Vec<String>
Convert to context strings for pattern matching
Trait Implementations§
Source§impl Clone for CDecisionContext
impl Clone for CDecisionContext
Source§fn clone(&self) -> CDecisionContext
fn clone(&self) -> CDecisionContext
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 CDecisionContext
impl Debug for CDecisionContext
Source§impl<'de> Deserialize<'de> for CDecisionContext
impl<'de> Deserialize<'de> for CDecisionContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CDecisionContext
impl RefUnwindSafe for CDecisionContext
impl Send for CDecisionContext
impl Sync for CDecisionContext
impl Unpin for CDecisionContext
impl UnsafeUnpin for CDecisionContext
impl UnwindSafe for CDecisionContext
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