title: What is the difference between :: and . in Rust?
body: <p>I am confused by the difference between <code>::</code> and <code>.</code>. They look the same except that their syntax are different.</p>
  
  <blockquote>
  <pre><code>let mut guess = String::new();
  
  io::stdin().read_line(&amp;mut guess)
      .expect("Failed to read line");
  </code></pre>
  </blockquote>
  
  <p><a href="https://doc.rust-lang.org/book/2018-edition/ch02-00-guessing-game-tutorial.html" rel="noreferrer">"Programming a Guessing Game" from <em>The Rust Programming Language</em></a></p>
  
  <p>In the above case, I access the function <code>new()</code> in <code>String</code>. What is the difference between <code>String::new()</code> and <code>String.new()</code>? Is <code>.</code> only for methods?</p>