At the junction of interfaces

Suppose that I have this datum:

let chars : *mut u8 = ... ;
let size : u8 = ... ;

How can I pass this to a function that expect &[u8] ?

You can use std::slice::from_raw_parts.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.