title: Can you disable constructor syntax for a type?
body: <p>Say I define my own type in a Rust library, like so:</p>
  <pre><code>struct Date {
      year: u16,
      month: u8,
      day: u8
  }
  
  impl Date {
      fn new(y: u16, m: u8, d: u8) -&gt; Date {
          // Do some validation here first
          Date { year: y, month: m, day: d }
      }
  }
  </code></pre>
  <p>Is there a way to <strong>require</strong> users to use the <code>Date::new</code> constructor? In other words, can I somehow prohibit users from creating their own <code>Date</code> struct using the following constructor:</p>
  <pre><code>let d = Date { 2017, 7, 10 };
  </code></pre>
  <p>I ask because it seems to be a detrimental flaw if you cannot force developers to run their arguments through a battery of validation before setting the members of a struct. (Although, maybe there is some other pattern that I should use in Rust, like validating data when they are used rather than when they are created; feel free to comment on that.)</p>