To sum up what is done when an already parsed expression is call from C# :
- only if the identifier exists in the expression, the identifier / value pair is send through FFI
- dotnet converts string to CStr when calling the native method
|
public static extern FFIStringHandle ffi_exec_expr(FFIExpressionHandle ptr, FFIIdentifierKeyValue[] identifier_values, UIntPtr identifier_values_len); |
- then when the Rust side wants to use the string it's converting back the CStr to Rust String
It's really a pitty !
Is there a way to send a string usable directly from Rust, or to send a raw dotnet pointer to the String an allow Rust to go digging the value right into C# managed memory ... I need help here ...
To sum up what is done when an already parsed expression is call from C# :
csharp-expr-rs/src-csharp/csharp-expr-rs/Native.cs
Line 19 in e086692
csharp-expr-rs/src/lib.rs
Line 498 in e086692
It's really a pitty !
Is there a way to send a string usable directly from Rust, or to send a raw dotnet pointer to the String an allow Rust to go digging the value right into C# managed memory ... I need help here ...