Equivalent of struct->ptr = (char*) data in rust

I think this thread should answer your question When does dereferencing a pointer create a copy?