Skip to main content

rewrite_self_in_params

Function rewrite_self_in_params 

Source
fn rewrite_self_in_params(sig: &mut Signature, concrete_type: &Type)
Expand description

Rewrite Self → concrete type in a method signature’s parameters.

&Self params are left as-is because generate_trait_method_c_wrapper detects them via type_inspect::self_ref_mutability and generates ExternalPtr<T> extraction.

The return type keeps Self, as in a trait impl with method bodies: the C wrapper hands a Self / Option<Self> / Result<Self, E> back as an ExternalPtr without naming the type, and the R wrapper re-wraps exactly those returns into an object of the class (TraitMethod::returns_self and its siblings look for Self).