![Rust Standard Library Cookbook](https://wfqqreader-1252317822.image.myqcloud.com/cover/74/36700074/b_36700074.jpg)
上QQ阅读APP看书,第一时间看更新
Using the constructor pattern
You may have asked yourself how to idiomatically initialize complex structs in Rust, considering it doesn't have constructors. The answer is simple, there is a constructor, it's just a convention rather than a rule. Rust's standard library uses this pattern very often, so we need to understand it if we want to use the std effectively.