Module interoptopus::patterns::string [−][src]
Expand description
Raw *const char
pointer on C-level but ASCII string
like in languages that support it.
Example
In your library you can accept ASCII strings like this:
use interoptopus::ffi_function; use interoptopus::patterns::string::AsciiPointer; #[ffi_function] #[no_mangle] pub extern "C" fn call_with_string(_string: AsciiPointer) { // }
Backends supporting this pattern might generate the equivalent to the following pseudo-code:
void call_with_string(string _string);
Backends not supporting this pattern, and C FFI, will see the equivalent of the following C code:
void call_with_string(uint8_t* _string);
Structs
Represents a *const char
on FFI level pointing to an 0x0
terminated ASCII string.