Understanding Box, ref, & and * in Rust: what's the difference and how to use them?
Hello everyone! I recently started learning Rust and I'm constantly confused about these four things: `Box`, `ref`, `&` and `*`. I understand that they are all somehow related to pointers and references, but I can't grasp when to use what.\n\nFor example, I write this program:\n\n```rust\nfn main() {\n let x = 42;\n let y = &x; // reference\n let z = Box::new(x); // Box\n println!("{} {}", y, z);\n}\n```\n\nThis works fine. But when I try to do something more complex, like pattern matching, everything breaks:\n\n```rust\nfn main() {\n let maybe_number = Some(10);\n match maybe_number {\n Some(ref x) => println!("Got {}", x),\n None => println!("Nothing here"),\n }\n}\n```\n\nWhy do I need `ref` here, and not just `x`? And how is `*` different from `&`? I read that `*` is a