3 ms·
Inside Rust it doesn't matter, because Rust gets to pick its own ABI rules. So this only matters for the FFI case and it's probably usually a bad idea to give
by tialaramex 3y ago
Inside Rust it doesn't matter, because Rust gets to pick its own ABI rules.
So this only matters for the FFI case and it's probably usually a bad idea to give a mutable String (as opposed to a read-only &str) to foreign language code.
Likewise for Vec<T> and &[T] indeed underneath Rust's String is literally Vec<u8> and &str is literally &[u8] but in both cases with the explicit requirement that the bytes are valid UTF-8 text.