pub struct FunctionHelperVirtual {
    pub function_name: String,
    pub generated_args: String,
    pub generated_function_body: Vec<String>,
    pub generated_virtual_function_signature: String,
    pub return_type: Option<WrapperType>,
    pub arg_names: Vec<String>,
    /* private fields */
}

Fields§

§function_name: String§generated_args: String§generated_function_body: Vec<String>§generated_virtual_function_signature: String§return_type: Option<WrapperType>§arg_names: Vec<String>

Implementations§

Translates the intermediate form of a parsed function into the elements ready-to-use in the C++ code generation process. It prepares code for a C++ virtual method declaration and extern “C” function that calls the virtual method. Due to this, Rust code can call virtual C++ methods like trait functions.

Pseudocode:

Rust: SomeTrait { method_a(); }

Swift: Class SomeTrait { method_a(); }

@_cdecl __method_a(AnyType obj) { (obj as SomeTrait).method_a(); }

Generates a virtual function declaration that can be used within a class declaration.

Generates an extern function that calls the virtual method on a swift trait object that can be mapped to some Rust trait object.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.