{"id":272468,"date":"2016-01-19T21:01:01","date_gmt":"2016-01-19T18:01:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=272468"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=272468","title":{"rendered":"\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u044f\u0437\u044b\u043a\u0430 Rust(\u0447\u0430\u0441\u0442\u044c 2)"},"content":{"rendered":"<br \/>\n<h5><b>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c<\/b><\/h5>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 main.rs \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c \u2014 <b>number2<\/b>. \u0418 \u0432 \u043d\u0451\u043c \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>one2()<\/i>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435 \u00abone\u00bb, \u0430 \u00abone2\u00bb.<br \/>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c:<\/p>\n<pre><code class=\"rust\">use num::number; use num::number2; <\/code><\/pre>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u041a\u043e\u043c\u0430\u043d\u0434\u0443\u0435\u043c\u2026 \u0417\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0432 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 <b>num<\/b> \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043e \u0448\u0442\u0443\u043a 20 \u0434\u0440\u0443\u0433\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439? \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0436\u0435 \u043c\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c:<\/p>\n<pre><code class=\"rust\">use num::number; use num::number2; use num::next; ... <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"rust\">use num::{number, number2, next, ...};      \/\/ \u0412\u0441\u0435 \u0440\u0430\u0437\u043e\u043c! <\/code><\/pre>\n<p>  \u041f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0432 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0445 \u0441\u043a\u043e\u0431\u043a\u0430\u0445 \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u043f\u044f\u0442\u0443\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043d\u0430\u043c \u043c\u043e\u0434\u0443\u043b\u0438, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <b>num<\/b>(<b>num<\/b> \u2014 \u044d\u0442\u043e src\/lib.rs). \u0417\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u043c \u0444\u0438\u0433\u0443\u0440\u043d\u043e\u0439 \u0441\u043a\u043e\u0431\u043a\u043e\u0439 \u0438 \u0442\u043e\u0447\u043a\u043e\u0439 \u0441 \u0437\u0430\u043f\u044f\u0442\u043e\u0439. \u0418 \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!!! <\/p>\n<p>  \u0412\u043e\u043f\u0440\u043e\u0441: \u0430 \u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0437 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 <b>number <\/b> \u0438 <b>number2<\/b> \u0432 \u0441\u0430\u043c\u043e\u043c \u043c\u043e\u0434\u0443\u043b\u0435 <b>num<\/b>? \u0434\u0430\u0432\u0430\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c:<br \/>  1) \u041f\u0438\u0448\u0435\u043c \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <b>num<\/b> \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>libfn()<\/i>:  <\/p>\n<pre><code class=\"rust\">pub fn libfn() { \tprintln!(&quot;{} + {} = 2&quot;,number::one(), number::one());      \/\/ one + one = 2 } <\/code><\/pre>\n<p>  3) \u0414\u0430\u043b\u0435\u0435 \u0432 main.rs \u043f\u0438\u0448\u0435\u043c:  <\/p>\n<pre><code class=\"rust\">extern crate num;  fn main() { \tnum::libfn();       \/\/ \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c libfn(). } <\/code><\/pre>\n<p>  \u0418 \u043a\u043e\u043c\u0430\u043d\u0434\u0443\u0435\u043c\u2026 <br \/>  \u0432\u044b\u0445\u043e\u0434:<\/p>\n<p>  <i>one + one2 = 2<\/i><\/p>\n<p>  \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u2014 \u0437\u043d\u0430\u0447\u0438\u0442 \u043c\u043e\u0436\u0435\u043c. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043f\u0443\u0442\u044c \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0410 \u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0445 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u0438\u043c\u0435\u043d\u0438(\u0431\u0435\u0437 \u043f\u0443\u0442\u0438)? \u041f\u0440\u043e\u0431\u0443\u0435\u043c:<br \/>  1) \u041f\u0438\u0448\u0435\u043c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c <b>num<\/b> \u043d\u0430\u0434 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044f\u043c\u0438(<\/p>\n<blockquote><p><i>Rust \u0442\u0440\u0435\u0431\u0443\u0435\u0442, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f <b>use<\/b> \u0448\u043b\u0438 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c<\/i><\/p><\/blockquote>\n<p>) \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"rust\">use self::number::one;   \/\/ \u041c\u044b \u043a\u0430\u043a \u0431\u044b \u0432\u0432\u043e\u0434\u0438\u043c \u0438\u0445 \u0432 \u043d\u0430\u0448\u0443 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438. use self::number2::one2; <\/code><\/pre>\n<p>  2) + \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"rust\">println!(&quot;{} + {} = 2&quot;,one(), one2());     \/\/ one + one2 = 2 <\/code><\/pre>\n<p>  \u0418 \u043a\u043e\u043c\u0430\u043d\u0434\u0443\u0435\u043c\u2026 \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442.   <\/p>\n<blockquote><p><i>\u0427\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e self? \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f use \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435<br \/>  \u043f\u0443\u0442\u0438, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 \u043a\u043e\u0440\u043d\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430. self, \u043d\u0430\u043f\u0440\u043e\u0442\u0438\u0432, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u0438 \u043f\u0443\u0442\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e<br \/>  \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u0432 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438. \u0423 use \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u0430 \u043e\u0441\u043e\u0431\u0430\u044f \u0444\u043e\u0440\u043c\u0430: \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c use<br \/>  super::, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u043d\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u0434\u0435\u0440\u0435\u0432\u0443 \u043d\u0430 \u043e\u0434\u0438\u043d \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0432\u0432\u0435\u0440\u0445 \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e<br \/>  \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0434\u0443\u043c\u0430\u0442\u044c \u043e self \u043a\u0430\u043a \u043e., \u0430 \u043e super \u043a\u0430\u043a \u043e\u2026, \u0447\u0442\u043e<br \/>  \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u0438\u0445 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u044b\u0445 \u043e\u0431\u043e\u043b\u043e\u0447\u0435\u043a \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0438 \u0434\u043b\u044f<br \/>  \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/i><\/p><\/blockquote>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u044f, \u043d\u0430\u0432\u0435\u0440\u043d\u043e, \u043c\u043e\u0433\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>one()<\/i> \u0438 <i>one2()<\/i> \u0432 main.rs, \u0432\u0435\u0434\u044c \u043c\u043e\u0434\u0443\u043b\u044c <b>num<\/b> \u0432 \u043d\u0430\u0448\u0435\u0439 \u043e\u0431\u043b\u0430\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438\u2026 \u041f\u0438\u0448\u0435\u043c \u0432 main.rs:<\/p>\n<pre><code class=\"rust\">extern crate num; fn main() { \tprintln!(&quot;{}&quot;,one());      \/\/ \u0412\u0435\u0434\u044c \u043e\u0434\u043d\u0430 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0434\u043e\u043b\u0436\u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c. \tprintln!(&quot;{}&quot;,num::one()); } <\/code><\/pre>\n<p>  \u041d\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043a\u0438:<\/p>\n<p>  <i>error: unresolved name `one`<br \/>  error: unresolved name `num::one`<\/i><\/p>\n<p>  \u0418 \u0447\u0442\u043e \u043d\u0435 \u0442\u0430\u043a? \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c. \u041f\u0438\u0448\u0435\u043c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c <b>num<\/b> \u0432\u043c\u0435\u0441\u0442\u043e<\/p>\n<pre><code class=\"rust\">use self::number::one; use self::number2::one2; <\/code><\/pre>\n<p>  \u044d\u0442\u043e:<\/p>\n<pre><code class=\"rust\">pub use self::number::one; pub use self::number2::one2; <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c:<\/p>\n<p>  <i>$ cargo run<br \/>  <\/i><br \/>  \u0410\u0433\u0430! \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u043e\u0448\u0438\u0431\u043a\u0430:<\/p>\n<p>  <i>error: unresolved name `one`<\/i><\/p>\n<p>  \u041d\u0443 \u0442\u0435\u043f\u0435\u0440\u044c-\u0442\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e. \u041c\u044b \u0441\u0434\u0435\u043b\u0430\u0430\u043b\u0438 \u0432\u0438\u0434\u0438\u043c\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>one()<\/i> \u0438 <i>one2()<\/i> \u0432 \u043c\u043e\u0434\u0443\u043b\u0435 <b>num<\/b>, \u043d\u043e \u0447\u0442\u043e\u0431\u044b \u0434\u043e \u043d\u0438\u0445 \u0434\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0439\u0442\u0438 \u0447\u0435\u0440\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044c <b>num<\/b>:<\/p>\n<pre><code class=\"rust\">num::one() <\/code><\/pre>\n<p>  \u0417\u043d\u0430\u0447\u0438\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <b>use<\/b> \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0438\u0445 \u0432\u0438\u0434\u0438\u043c\u044b\u043c\u0438 \u0432 \u043c\u043e\u0434\u0443\u043b\u0435, \u043d\u043e \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0438\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 main.rs \u0438\u0445 \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c\u0438! <\/p>\n<blockquote><p><i>\u0412 \u043d \u0435 <b>use<\/b>, \u043f\u0443\u0442\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b: foo::bar() \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u043d\u0443\u0442\u0440\u0438 foo<br \/>  \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u043e\u0433\u043e, \u0433\u0434\u0435 \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u0441\u044f. \u0415\u0441\u043b\u0438 \u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0444\u0438\u043a\u0441 ::, \u0442\u043e ::foo::bar()<br \/>  \u0431\u0443\u0434\u0435\u0442 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439 foo, \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0439 \u043f\u0443\u0442\u044c \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a\u043e\u0440\u043d\u044f \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/i><\/p><\/blockquote>\n<p>  \u041d\u0430\u0434\u043e\u0431\u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u044b\u0442\u0430\u0442\u044c <b>use super::<\/b>, \u0430 \u043f\u043e\u0442\u043e\u043c <b>::<\/b>.<br \/>  \u041f\u0438\u0448\u0435\u043c \u0432 number\/mod.rs \u0432\u0432\u0435\u0440\u0445\u0443:<\/p>\n<pre><code class=\"rust\">use super::libfn2; <\/code><\/pre>\n<p>  \u0418 \u043d\u0438\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e:<\/p>\n<pre><code class=\"rust\">pub fn superfn() { \tlibfn2();     \/\/ \u0412\u044b\u0437\u043e\u0432 llibfn2(). } <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c <b>num<\/b> \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>libfn2(<\/i>):<\/p>\n<pre><code class=\"rust\">fn libfn2() { \tprintln!(&quot;super works&quot;); } <\/code><\/pre>\n<p>  \u041f\u0438\u0448\u0435\u043c \u0432 main.rs:<\/p>\n<pre><code class=\"rust\">fn main() { \tnum::number::superfn();     \/\/ \u0412\u044b\u0437\u043e\u0432 superfn(). } <\/code><\/pre>\n<p>  \u0418 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c.\u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0410 \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u0435\u0440\u0435\u0434 <b>use super<\/b> \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c <b>pub<\/b>? \u041f\u0440\u043e\u0431\u0443\u0435\u043c:<\/p>\n<p>  \u0414\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 number\/mod.rs \u0441\u043b\u043e\u0432\u043e <b>pub<\/b>. \u0414\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043c\u043e\u0434\u0443\u043b\u044c <b>num<\/b> \u043f\u0435\u0440\u0435\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <i>libfn2()<\/i> \u0441\u043b\u043e\u0432\u043e <b>pub<\/b>( \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0435\u044e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f). \u0418\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0432 main.rs \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"rust\">num::number::libfn2(); <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u042f \u0432 \u0432\u043e\u0441\u0442\u043e\u0440\u0433\u0435!!! \u041d\u0443, \u0430 \u0435\u0441\u043b\u0438 \u043c\u044b \u0432\u043c\u0435\u0441\u0442\u043e <b>pub use super::libfn2;<\/b> \u043d\u0430\u043f\u0438\u0448\u0435\u043c:<\/p>\n<p>  1) <b>pub use super::libfn;<\/b> <br \/>  2) \u0423\u0434\u0430\u043b\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>libfn2()<\/i>; \/\/ \u0422.\u043a. \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0435 \u0432\u0438\u0434\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>libfn2()<\/i> \u043e\u043d \u0432\u044b\u0434\u0430\u0441\u0442 \u043e\u0448\u0438\u0431\u043a\u0443.<br \/>  3) \u0418\u0437\u043c\u0435\u043d\u0438\u043c \u0432 main.rs \u0438\u043c\u044f \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"rust\">num::number::libfn(); <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442\u2026<\/p>\n<h5><b>\u0422\u0435\u043f\u0435\u0440\u044c ::<\/b><\/h5>\n<p>  \u0418\u0441\u043b\u0438 \u043f\u043e\u0434\u0443\u043c\u0430\u0442\u044c, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434, \u0447\u0442\u043e <\/p>\n<pre><code class=\"rust\">pub use ::libfn; <\/code><\/pre>\n<p>  \u0438 <\/p>\n<pre><code class=\"rust\">pub use super::libfn; <\/code><\/pre>\n<p>  \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b, \u043d\u043e \u043d\u0430\u043c \u0432\u0441\u0451 \u0436\u0435 \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c. \u041f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c, \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c. \u041c\u044b \u043e\u043a\u0430\u0437\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u0430\u0432\u044b: \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442.<\/p>\n<h5>\u041d\u0443, \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u043e\u043a\u0430 \u0432\u0441\u0451. \u0414\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0438, \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044c.<\/h5>\n<p>  <b>\u041b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u0430:<\/b><\/p>\n<p>  <a href=\"https:\/\/doc.rust-lang.org\/reference.html\">The Rust Reference<\/a> (\u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439)<br \/>  <a href=\"https:\/\/doc.rust-lang.org\/stable\/book\/\">The Rust Programming Language<\/a> (\u0430\u043d\u0433\u043b\u0438\u0439\u0441\u043a\u0438\u0439)<br \/>  <a href=\"http:\/\/kgv.github.io\/rust_book_ru\/src\/INTRODUCTION.html\">The Rust Programming Language<\/a> (\u0440\u0443\u0441\u0441\u043a\u0438\u0439)               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/275533\/\"> http:\/\/habrahabr.ru\/post\/275533\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<br \/>\n<h5><b>\u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c<\/b><\/h5>\n<p>  \u0425\u043e\u0440\u043e\u0448\u043e. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432 main.rs \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043c\u043e\u0434\u0443\u043b\u044c \u2014 <b>number2<\/b>. \u0418 \u0432 \u043d\u0451\u043c \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>one2()<\/i>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435 \u00abone\u00bb, \u0430 \u00abone2\u00bb.<br \/>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c:<\/p>\n<pre><code class=\"rust\">use num::number; use num::number2; <\/code><\/pre>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-272468","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/272468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=272468"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/272468\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=272468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=272468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=272468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}