title: How can I hide a method in a child module but still use it from a parent module?
body: <p>I have a parent structure defined at my crate root that returns a structure that is defined in a module. I would like my parent structure to be the only thing that is capable of constructing the child structure, but I quickly run into understandable privacy and visibility issues with my naïve attempt:</p>
  
  <pre><code>#![feature(unsafe_destructor)]
  
  mod child {
      pub struct Child(u8);
  
      impl Child {
          fn new(v: u8) -&gt; Child { Child(v) }
      }
  }
  
  struct Parent;
  
  impl Parent {
      fn child(&amp;self) -&gt; child::Child {
          child::Child::new(42)
      }
  }
  
  fn main() {}
  </code></pre>