re: Calling Rust from C# VIEW POST

re: Yes, I had issues with bools as well, I didn't cover it in the article because it's weird. What I ended up doing was setting them up in c# as a byt...

C# bools are Win32 BOOLs are 32-bit signed integers, for historical reasons.

Still, Marshall as book "should" work, correct?

bool on the Rust side but byte on the C# side, or (better) make a user-defined struct on the C# side, e.g. "ByteBool", that holds a single byte value and implements the conversions to/from System.Boolean.

public struct test
public ByteBool isbool;

code of conduct - report abuse