title: What is exactly lvalue context in Rust?
body: <p>According to <a href="https://doc.rust-lang.org/reference.html#lvalues-rvalues-and-temporaries" rel="nofollow noreferrer">the documentation</a>, we have lvalue and rvalue contexts. How do I know if an expression is in an lvalue context? Is it determined just by the side of the expression in an assignment?</p>
  
  <p>To be more concrete, I need to understand when <code>DerefMut</code> is used for dereferencing and when <code>Deref</code> is used instead? Same with <code>Index</code> and <code>IndexMut</code>.</p>