title: How to create *mut u8 from Rust string?
body: <p>I'm new to Rust. I want to create a mutable u8 buffer. </p>
  
  <p>I tried</p>
  
  <pre><code>let mut str = "hello";
  let r = str as *mut u8;
  </code></pre>
  
  <p>but I get</p>
  
  <pre><code>error[E0606]: casting `&amp;str` as `*mut u8` is invalid
  </code></pre>
  
  <p>I want to know how but also why. What is the type of "hello"? How does casting works on Rust?</p>