{"id":326198,"date":"2021-07-09T09:00:30","date_gmt":"2021-07-09T09:00:30","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=326198"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=326198","title":{"rendered":"\u041a\u043e\u043d\u0441\u043f\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u041a\u043d\u0438\u0433\u0443 Rust:: \u0412\u043b\u0430\u0434\u0435\u043d\u0438\u0435"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p><a href=\"https:\/\/habr.com\/ru\/users\/nurked\/\" class=\"user_link\">Nurked<\/a> <a href=\"https:\/\/habr.com\/ru\/post\/537790\/\">\u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b<\/a> \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f <a href=\"https:\/\/doc.rust-lang.org\/book\/title-page.html\" rel=\"nofollow noopener noreferrer\">&quot;the book&quot;<\/a> \u2014 \u0447\u0438\u0442\u0430\u0442\u044c \u0433\u043b\u0430\u0432\u044b \u043d\u0430\u0434\u043e \u043d\u0435 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443, \u0430 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 [4, 3, 5, 6, 8, 4, 9, 7, 10, 4, 13, 17, 15, 16].<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0439\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435. \u041c\u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0435\u0433\u0447\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b\u043a\u0438\u043d\u0443\u0442\u044c \u0431\u043e\u0301\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d &quot;\u043f\u0440\u043e\u0431\u043d\u0438\u043a&quot; \u0432 \u0432\u0438\u0434\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e\u0439 \u0433\u043b\u0430\u0432\u044b 4. \u0427\u0442\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u043f\u044b\u0442\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u2014 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 &quot;\u0447\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0435\u043a \u043e\u0442 \u043a\u0443\u0447\u0438&quot;, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u043e\u043f\u0430\u043b\u0438 \u043f\u043e\u0434 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e. <\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041b\u0438\u0440\u0438\u043a\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u0418\u0437 \u0442\u0435\u0445 \u044f\u0437\u044b\u043a\u043e\u0432, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u043f\u043b\u043e\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b, Rust \u0431\u043b\u0438\u0436\u0435 \u0432\u0441\u0435\u0433\u043e, \u041a\u041c\u041a, \u043a Go. \u0418\u0445 \u0440\u043e\u0434\u043d\u0438\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 &quot;\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u041e\u041e\u041f&quot;, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 &quot;\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439&quot;, \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u0441\u0440\u0435\u0437\u043e\u0432 (slice), \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0442\u0430\u043a \u0438 \u0441\u0441\u044b\u043b\u043e\u043a\/\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u043d\u0438\u0445, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u0443 \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f &quot;\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438&quot;. \u0412 Go \u043f\u043e\u043a\u0430 \u043d\u0435\u0442 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043d\u043e \u043f\u0440\u043e \u043d\u0438\u0445 \u0437\u043d\u0430\u044e\u0442 \u0438 \u0438\u0445 \u0436\u0434\u0443\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u044b\u0442\u043d\u043e\u0433\u043e \u0433\u043e\u0444\u0435\u0440\u0430 \u0440\u0436\u0430\u0432\u0447\u0438\u043d\u043e\u0439 \u043d\u0435 \u0438\u0441\u043f\u0443\u0433\u0430\u0442\u044c.<\/p>\n<\/div><\/div>\n<p><a name=\"habracut\"><\/a>  <\/p>\n<h1 id=\"upravlenie-pamyatyu\">\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e<\/h1>\n<p>  <\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u043b\u0430\u0434\u0435\u043b\u0435\u0446 (owner) \u043f\u043e\u043a\u0438\u0434\u0430\u0435\u0442 \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 (variable scope), \u0435\u0433\u043e &quot;\u0444\u0438\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u044e\u0442&quot; \u0447\u0435\u0440\u0435\u0437 \u0432\u044b\u0437\u043e\u0432 drop():<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">    {         let s = String::from(&quot;hello&quot;); \/\/ s is valid from this point forward          \/\/ do stuff with s     }                           \/\/ This scope is now over, and s is no longer valid     \/\/ Rust calls s.drop() automatically at the closing curly bracket.<\/code><\/pre>\n<p>  <\/p>\n<p>The book \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442, \u0447\u0442\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043c\u044f\u0442\u044c\u044e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 &quot;\u0432\u043b\u0430\u0434\u0435\u043d\u0438\u0435&quot; \u0441 \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u043f\u0440\u0430\u0432\u0438\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b. \u041f\u043e\u043b\u0435\u0437\u043d\u043e \u0441\u0440\u0430\u0437\u0443 \u0438\u043c\u0435\u0442\u044c \u0432 \u0432\u0438\u0434\u0443 (\u043d\u0430\u043f\u043e\u043c\u043d\u044e \u2014 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0434\u043b\u044f \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u043a\u0430\u043c\u0438\u043a\u0430\u0434\u0437\u0435), \u0447\u0442\u043e <a href=\"https:\/\/doc.rust-lang.ru\/book\/ch15-00-smart-pointers.html\" rel=\"nofollow noopener noreferrer\">\u0435\u0441\u0442\u044c \u043d\u0435\u043a\u0438\u0435<\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">- Box&lt;T&gt; \u0434\u043b\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043a\u0443\u0447\u0435 (\u043f\u0430\u043c\u044f\u0442\u0438) - Rc&lt;T&gt; \u0442\u0438\u043f \u0441\u0447\u0451\u0442\u0447\u0438\u043a\u0430 \u0441\u0441\u044b\u043b\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0432\u043b\u0430\u0434\u0435\u043d\u0438\u0435 - \u0422\u0438\u043f\u044b Ref&lt;T&gt; \u0438 RefMut&lt;T&gt;, \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0442\u0438\u043f RefCell&lt;T&gt;, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 - Rust \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0443\u0442\u0435\u0447\u043a\u0438 \u043f\u0430\u043c\u044f\u0442\u0438, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u0438\u043f\u044b Rc&lt;T&gt; \u0438 RefCell&lt;T&gt; \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u044f\u0437\u0438, \u0433\u0434\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u043d\u0430 \u0434\u0440\u0443\u0433\u0430 \u0432 \u0446\u0438\u043a\u043b\u0435<\/code><\/pre>\n<p>  <\/p>\n<p>\u041a\u043e\u0440\u043e\u0447\u0435, \u0435\u0441\u043b\u0438 \u043f\u0430\u043c\u044f\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043a\u0443\u0447\u0435, \u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u0434\u0440\u0443\u0433 \u043d\u0430 \u0434\u0440\u0443\u0433\u0430 \u2014 \u0431\u0443\u0434\u044c \u0433\u043e\u0442\u043e\u0432 \u043a \u0433\u0440\u0430\u0431\u043b\u044f\u043c, \u0437\u0430\u0441\u0430\u0434\u0430\u043c \u0438 \u043a \u043f\u043e\u0438\u0441\u043a\u0443 \u0443\u0442\u0435\u0447\u0435\u043a \u043f\u0430\u043c\u044f\u0442\u0438.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0412\u043e\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u043d\u0438\u0435 \u043e \u0431\u0443\u0434\u0443\u0449\u0435\u043c<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u0412 \u0441\u0438\u043b\u0443 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0432\u0430\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u0430 \u0437\u0430\u0431\u0435\u0433\u0443 \u0432\u043f\u0435\u0440\u0435\u0434.<\/p>\n<p>  <\/p>\n<p>\u0418\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 the book \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442, \u043c\u043e\u043b, \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f \u0437\u0430\u0446\u0438\u043a\u043b\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u0442\u0440\u0430\u0448\u043d\u044b, \u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c <a href=\"https:\/\/doc.rust-lang.org\/book\/ch15-06-reference-cycles.html\" rel=\"nofollow noopener noreferrer\">\u0438\u0434\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u0442\u0435\u043a\u0441\u0442<\/a>:<\/p>\n<p>  <\/p>\n<blockquote><p>However, if a more complex program allocated lots of memory in a cycle and held onto it for a long time, the program would use more memory than it needed and might overwhelm the system, causing it to run out of available memory.<\/p><\/blockquote>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u0438\u0441\u0442\u0435\u043c \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u043e\u0439 \u043d\u0430\u0434\u043e \u0431\u044b\u0442\u044c \u043d\u0430\u0447\u0435\u043a\u0443 \u2014 \u043c\u043e\u0436\u0435\u0442 &quot;\u043d\u0430\u0442\u0435\u0447\u044c&quot; \u043c\u043d\u043e\u0433\u043e \u0438 \u0431\u044b\u0441\u0442\u0440\u043e. Rust \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0434\u043b\u044f \u0431\u043e\u0440\u044c\u0431\u044b \u0441 \u044d\u0442\u0438\u043c, \u0442\u0438\u043f\u0430 \u0437\u0430\u043c\u0435\u043d\u044b \u0443\u043c\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f Rc \u043d\u0430 Weak, \u043d\u043e \u0432\u0441\u0435 \u044d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u0437\u0430\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u0430\u043d\u0446\u044b \u0441 \u0437\u0430\u043c\u044b\u0441\u043b\u043e\u0432\u0430\u0442\u044b\u043c \u0440\u0438\u0441\u0443\u043d\u043a\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0440\u0435\u0431\u0435\u043d\u043a\u0430 \u043a \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044e <a href=\"https:\/\/doc.rust-lang.org\/book\/ch15-06-reference-cycles.html\" rel=\"nofollow noopener noreferrer\">\u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/a>:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">use std::cell::RefCell; use std::rc::{Rc, Weak};  \/\/ The `derive` attribute automatically creates the implementation \/\/ required to make this `struct` printable with `fmt::Debug`. #[derive(Debug)] struct Node {     value: i32,     parent: RefCell&lt;Weak&lt;Node&gt;&gt;,     children: RefCell&lt;Vec&lt;Rc&lt;Node&gt;&gt;&gt;, }  fn main() {     let leaf = Rc::new(Node {         value: 3,         parent: RefCell::new(Weak::new()),         children: RefCell::new(vec![]),     });      println!(&quot;leaf parent = {:?}&quot;, leaf.parent.borrow().upgrade());      let branch = Rc::new(Node {         value: 5,         parent: RefCell::new(Weak::new()),         children: RefCell::new(vec![Rc::clone(&amp;leaf)]),     });      *leaf.parent.borrow_mut() = Rc::downgrade(&amp;branch);      println!(&quot;leaf parent = {:?}&quot;, leaf.parent.borrow().upgrade()); }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0443\u0436 \u0431\u043e\u043b\u044c\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0431\u0443\u043a\u0432 \u043d\u0430\u0434\u043e \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432 \u043d\u0443\u0436\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u043d\u0435\u0443\u0436\u0435\u043b\u0438 \u0447\u0435\u043b\u043e\u0432\u0435\u043a \u043c\u043e\u0436\u0435\u0442 \u043e\u0441\u0438\u043b\u0438\u0442\u044c \u0441\u0438\u0435 \u0438 \u043d\u0435 \u043d\u0430\u043b\u043e\u043c\u0430\u0442\u044c \u0434\u0440\u043e\u0432? \u0425\u043e\u0440\u043e\u0448\u0438\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043d\u0435\u043f\u0440\u043e\u0441\u0442\u043e\u043c \u0434\u0435\u043b\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0438 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0430 \u043f\u0440\u043e\u0447\u043d\u043e\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043b\u0435\u0447\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430 Rust, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0436\u0435\u0441\u0442\u043a\u043e \u043f\u0440\u0435\u0441\u0435\u043a\u0430\u0442\u044c \u043f\u043e\u043f\u044b\u0442\u043a\u0438 \u043d\u0435\u0431\u0440\u0435\u0436\u043d\u043e \u043e\u0442\u043d\u0435\u0441\u0442\u0438\u0441\u044c \u043a <a href=\"https:\/\/na-dostupnom.ru\/nalomat-drov\/\" rel=\"nofollow noopener noreferrer\">\u043c\u0435\u043b\u043a\u043e\u043c\u0443 \u0440\u0430\u0441\u0442\u043e\u043f\u043e\u0447\u043d\u043e\u043c\u0443 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u0443<\/a>.<\/p>\n<\/div><\/div>\n<p>  <\/p>\n<h1 id=\"tip-string\">\u0422\u0438\u043f String<\/h1>\n<p>  <\/p>\n<p>\u0411\u0435\u0437 \u043d\u0435\u0433\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0438\u043a\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">fn intro_string_type(){     let immutable_string = String::from(&quot;I'm immutable&quot;);     \/\/ immutable_string.push_str(&quot;!&quot;); \/\/ ERR: ^ cannot borrow as mutable      let mut mutable_string = String::from(&quot;I'm mutable&quot;);     mutable_string.push_str(&quot;!&quot;);      println!(&quot;immutable_string: {}&quot;, immutable_string);     println!(&quot;mutable_string: {}&quot;, mutable_string); }<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043a\u0440\u0443\u0442\u0438\u0442\u044c <a href=\"https:\/\/play.rust-lang.org\/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=043a26f5711780304968eb4c1ad8b98a\" rel=\"nofollow noopener noreferrer\">\u0442\u0443\u0442<\/a><\/li>\n<li><code>intro_string_type()<\/code>, \u043e\u0433\u043e, \u0437\u043c\u0435\u0438\u043d\u0430\u044f \u043d\u043e\u0442\u0430\u0446\u0438\u044f \u2014 <a href=\"https:\/\/www.youtube.com\/watch?v=d_W1R9xzoI4\" rel=\"nofollow noopener noreferrer\">\u0442\u0430\u043a \u043d\u0430\u0434\u043e<\/a><\/li>\n<li>\u041f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 <code>let<\/code>, \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f<\/li>\n<li>\u0415\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <code>let mut<\/code><\/li>\n<li>\u0412\u044b\u0432\u043e\u0434 \u043d\u0430 \u043f\u0435\u0447\u0430\u0442\u044c \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0447\u0443\u0434\u043b\u0438\u0432\u043e\u0439 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 <code>println!<\/code> (\u0442\u0443\u0442 \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e\u0435 \u043f\u043e\u0434\u043e\u0437\u0440\u0435\u043d\u0438\u0435, \u0447\u0442\u043e \u044d\u0442\u043e \u043d\u0435 &quot;\u043e\u0431\u044b\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f&quot;)<\/li>\n<\/ul>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041b\u0438\u0440\u0438\u043a\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u042f \u0434\u0443\u043c\u0430\u044e, Rust \u0438\u043c\u0435\u0435\u0442 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043e\u0442\u043a\u043b\u0438\u043a \u0432 \u0441\u0435\u0440\u0434\u0446\u0430\u0445 \u043c\u043d\u043e\u0433\u0438\u0445. <code>let<\/code> \u043a\u0430\u043a \u0432 \u0411\u0435\u0439\u0441\u0438\u043a\u0435, <code>{}<\/code> \u043a\u0430\u043a \u0432 Java, <code>::<\/code> \u043a\u0430\u043a \u0432 \u0421++, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0442\u0430\u043a\u043e\u0432\u043e\u0435 \u0438\u0437 Go (\u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0430\u043c <code>func<\/code>)<\/p>\n<\/div><\/div>\n<p>  <\/p>\n<h1 id=\"vladenie-i-ego-peredacha-prisvaivaniem-move\">\u0412\u043b\u0430\u0434\u0435\u043d\u0438\u0435 \u0438 \u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435\u043c (Move)<\/h1>\n<p>  <\/p>\n<p><strong>\u041a\u0430\u0436\u0434\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430-\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e<\/strong>. \u041f\u043e\u0441\u043b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0442\u0438\u043f\u0430 String \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u0432\u043b\u0430\u0434\u0435\u0442\u044c \u0441\u0432\u043e\u0438\u043c \u0431\u044b\u0432\u0448\u0438\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c, \u0438 \u0435\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u0431\u043e\u043b\u044c\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">fn once_assigned_string_may_not_be_used_anymore(){     let s1 = String::from(&quot;5&quot;);     let s2 = s1; \/\/ Ownership is moved here     \/\/ let s3 = s1; \/\/ ERR: value used here after move     \/\/ println!(&quot;{}, world!&quot;, s1); \/\/ ERR: value borrowed here after move }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 (primitive types), \u043e\u0434\u043d\u0430\u043a\u043e, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f, \u0438 \u0434\u043b\u044f \u043d\u0438\u0445 \u043c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e\u0435 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">fn primitives_are_copied(){     let i1 = 5;     let i2 = i1;     let i3 = i1; }<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li>\u0415\u0441\u0442\u044c trait (\u043a\u0430\u043a \u0431\u044b interface) <code>Copy<\/code>, \u0435\u0441\u043b\u0438 \u0442\u0438\u043f \u0435\u0433\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442, \u043f\u0440\u0438 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0438\/\u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e\/\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/li>\n<li><code>Copy<\/code> \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u043a\u0430\u043b\u044f\u0440\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043d\u0435\u043a\u0438\u0445 \u043a\u043e\u0440\u0442\u0435\u0436\u0435\u0439 (tuples), \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438, \u0447\u0442\u043e \u044d\u0442\u0438 \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u044b\u0435 \u043f\u043e\u043a\u0430 tuples \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f\u044b, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0435 <code>Copy<\/code><\/li>\n<li>\u0422\u0438\u043f <code>String<\/code> \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 <code>Copy<\/code><\/li>\n<li><strong>\u0418\u0437 \u043d\u0435\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0433\u043e<\/strong>: <code>Copy<\/code> \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c \u0441 <code>Drop<\/code> (\u044d\u0442\u043e \u0433\u0434\u0435 <code>drop()<\/code>). \u041d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0441\u0430\u043c \u0442\u0438\u043f, \u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0435\u0433\u043e \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0442 <code>Drop<\/code><\/li>\n<\/ul>\n<p>  <\/p>\n<h1 id=\"peredacha-i-vozvrat-parametra-po-znacheniyu\">\u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e<\/h1>\n<p>  <\/p>\n<p>\u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0432\u043b\u0430\u0434\u0435\u043d\u0438\u044f (\u0435\u0441\u043b\u0438 \u0442\u0438\u043f \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 <del>\u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441<\/del> trait <code>Copy<\/code>):<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">fn use_str_by_value(s: String){     println!(&quot;{}&quot;, s); }  fn passing_by_value_moves_ownership(){     let s1 = String::from(&quot;5&quot;);     use_str_by_value(s1);     \/\/ let s2 = s1; \/\/ ERR: value used here after move }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043a\u0440\u0443\u0433\u043e\u0437\u043e\u0440\u0430):<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\"> fn calculate_length(s: String) -&gt; (String, usize) {     let length = s.len();     return (s, length) }  fn calculate_length2(s: String) -&gt; (String, usize) {     let length = s.len();     (s, length) } <\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li>\u0418\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u0442\u043e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043a\u043e\u0440\u0442\u0435\u0436, \u0438\u043b\u0438 <code>tuple<\/code>)<\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/std\/primitive.usize.html\" rel=\"nofollow noopener noreferrer\">usize<\/a> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0446\u0435\u043b\u044b\u0439 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u0442\u0438\u043f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043c\u0435\u0449\u0430\u0435\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c (the pointer-sized unsigned integer type)<\/li>\n<li><code>return<\/code> \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c<\/li>\n<li>\u041f\u0440\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 &quot;\u043f\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e&quot; \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438 \u0432\u043b\u0430\u0434\u0435\u043d\u0438\u0435 (\u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u0435\u0441\u043b\u0438 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d <code>Copy<\/code>)<\/li>\n<\/ul>\n<p>  <\/p>\n<h1 id=\"ssylki-i-zaimstvovanie-references-and-borrowing\">\u0421\u0441\u044b\u043b\u043a\u0438 \u0438 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u0435 (References and Borrowing)<\/h1>\n<p>  <\/p>\n<p>\u041d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u0440\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u043e \u0432\u043b\u0430\u0434\u0435\u043d\u0438\u0435, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e &quot;\u0437\u0430\u043d\u044f\u0442\u044c&quot; (borrow):<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">fn borrow(){     let mut s = String::from(&quot;hello&quot;);      let r1 = &amp;s; \/\/ First immutable borrow occurs here     let r2 = &amp;s; \/\/ Second immutable borrow occurs here     \/\/ let r3 = &amp;mut s; \/\/ Err: mutable borrow occurs here     \/\/ r3.push_str(&quot; world&quot;);     let r3 = &amp;s; \/\/ Third immutable borrow occurs here      println!(&quot;{}, {}, and {}&quot;, r1, r2, r3); }<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li>\u0417\u0430\u043d\u044f\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f (<code>&amp;<\/code>), \u0442\u0430\u043a \u0438 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 (<code>&amp;mut<\/code>)<\/li>\n<li>\u0417\u0430\u043d\u044f\u0442\u044c \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f (immutable borrow) \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0443\u0433\u043e\u0434\u043d\u043e \u0440\u0430\u0437 \u0432 &quot;\u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439&quot; (variable scope)<\/li>\n<li>\u0417\u0430\u043d\u044f\u0442\u044c \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 (mutable borrow) \u2014 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437<\/li>\n<li>\u041d\u0435\u043b\u044c\u0437\u044f \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u0438 (\u0432\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 read\/write locks)<\/li>\n<li>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0437\u0430\u0438\u043c\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0441\u044b\u043b\u043a\u043e\u0439 (reference)<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041e\u0442 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u0442\u0440\u043e\u043a \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u044b\u0448\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">fn borrow2(){     let mut s = String::from(&quot;hello&quot;);      let r1 = &amp;s; \/\/ First immutable borrow occurs here     let r2 = &amp;s; \/\/ Second immutable borrow occurs here     println!(&quot;{}, {}&quot;, r1, r2); \/\/ hello, hello      let r3 = &amp;mut s; \/\/ Mutable borrow occurs here, r1 &amp; r2 are not used anymore and out of scope     r3.push_str(&quot; world&quot;);     println!(&quot;{}&quot;, r3); \/\/ hello world  }<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li><strong>\u0412\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043c, \u0433\u0434\u0435 \u043e\u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0440\u0430\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f<\/strong><\/li>\n<\/ul>\n<p>  <\/p>\n<h1 id=\"visyachie-ssylki-dangling-references\">\u0412\u0438\u0441\u044f\u0447\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 (Dangling References)<\/h1>\n<p>  <\/p>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Rust \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u044d\u0442\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0438\u0441\u043a\u043e\u0440\u0435\u043d\u0435\u043d\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e. \u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043e\u0442\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u043e\u043f\u044b\u0442\u043a\u0430\u043c\u0438 \u043f\u043e\u0434\u0432\u0435\u0441\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438, \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u0447\u0438\u043d\u044b \u043e\u0442\u043a\u0430\u0437\u0430 \u043e\u043d \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u0437\u0430\u0433\u0430\u0434\u043e\u0447\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u043a\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">\/\/ fn dangling_reference() -&gt; &amp;String { \/\/ ERR: expected named lifetime parameter \/\/     let s = String::from(&quot;hello&quot;); \/\/     return &amp;s \/\/ }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u0433\u0430\u0434\u043a\u0430 lifetime parameter \u043f\u043e\u043b\u0443\u0447\u0438\u0442 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u0435 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0433\u043b\u0430\u0432\u0430\u0445.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041b\u0438\u0440\u0438\u043a\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u0412 \u0441\u0432\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0431\u044b\u043b \u0443\u0434\u0438\u0432\u043b\u0435\u043d, \u0447\u0442\u043e \u0432 Go \u043c\u043e\u0436\u043d\u043e \u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0438 \u0437\u0430 \u044d\u0442\u043e \u0442\u0435\u0431\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"go\">\/\/go:noinline func ReturnPointerToLocal() *int{     a := 10     return &amp;a }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0430 \u0434\u0435\u043b\u0435 \u0445\u0438\u0442\u0440\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u043f\u0430\u043c\u044f\u0442\u044c \u0432 \u043a\u0443\u0447\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"plaintext\">;*** main.go#9    &gt;func ReturnPointerToLocal() *int{ ... ;*** main.go#10   &gt;     a := 10 0x4a7a04     488d0575b00000         LEAQ type.*+43648(SB), AX 0x4a7a0b     48890424               MOVQ AX, 0(SP) 0x4a7a0f     e84c5bf6ff             CALL runtime.newobject(SB) 0x4a7a14     488b442408             MOVQ 0x8(SP), AX 0x4a7a19     48c7000a000000         MOVQ $0xa, 0(AX)  ;*** main.go#11   &gt;     return &amp;a 0x4a7a20     4889442420             MOVQ AX, 0x20(SP) 0x4a7a25     488b6c2410             MOVQ 0x10(SP), BP 0x4a7a2a     4883c418               ADDQ $0x18, SP 0x4a7a2e     c3                     RET<\/code><\/pre>\n<\/div><\/div>\n<p>  <\/p>\n<h1 id=\"srezy-slices\">\u0421\u0440\u0435\u0437\u044b (Slices)<\/h1>\n<p>  <\/p>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">fn string_slice(){     let s = String::from(&quot;Yandex&quot;);     let the_third_and_fourth_bytes_slice  = &amp;s[2..4]; \/\/ nd     let the_whole_string_slice  = &amp;s[..]; \/\/ Yandex     let first_two_bytes_slice  = &amp;s[..2]; \/\/ Ya     let from_the_third_byte_slice  = &amp;s[2..]; \/\/ ndex }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">fn string_slice_multibyte(){     let s = String::from(&quot;y\u0306andex&quot;);     \/\/ let slice = &amp;s[0..1]; \/\/ ERR: thread 'main' panicked at 'byte index 1 is not a char boundary...     \/\/ let slice = &amp;s[0..2]; \/\/ ERR: thread 'main' panicked at 'byte index 1 is not a char boundary...     let valid_slice = &amp;s[0..3];     println!(&quot;valid_slice: {}&quot;, valid_slice); \/\/ y\u0306 }<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li>\u0421\u0440\u0435\u0437\u044b \u0441\u0442\u0440\u043e\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u0442\u0440\u0443\u044a-unicode-\u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c, \u0438\u043d\u0430\u0447\u0435 \u043f\u0430\u043d\u0438\u043a\u0430<\/li>\n<li>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 <a href=\"https:\/\/doc.rust-lang.ru\/book\/ch08-02-strings.html\" rel=\"nofollow noopener noreferrer\">\u0442\u0443\u0442<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/doc.rust-lang.org\/book\/ch08-02-strings.html\" rel=\"nofollow noopener noreferrer\">here<\/a>, \u043a\u043e\u043c\u0443 \u0447\u0442\u043e \u043b\u044e\u0431\u043e<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041d\u043e \u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438, \u0441 \u0431\u0430\u0439\u0442\u0430\u043c\u0438 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u043f\u043e\u043f\u0440\u043e\u0449\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">fn byte_slice(){     let s = String::from(&quot;y\u0306andex&quot;);     let bytes = s.as_bytes();     let slice = &amp;bytes[0..2];     println!(&quot;{:?}, len: {}&quot;, slice, slice.len()); \/\/ [121, 204], len: 2 }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u0440\u043e \u0432\u043b\u0430\u0434\u0435\u043d\u0438\u0435. \u0412\u0437\u044f\u0442\u0438\u0435 \u0441\u0440\u0435\u0437\u0430 &quot;\u043e\u0434\u0430\u043b\u0436\u0438\u0432\u0430\u0435\u0442&quot; \u0432\u0441\u044e \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">fn slice_borrow_the_whole_sequence() {     let mut s = String::from(&quot;hello&quot;);     let first_two_bytes_slice  = &amp;s[..2]; \/\/ he     \/\/ s.push_str(&quot; world&quot;); \/\/ Err: cannot borrow `s` as mutable because it is also borrowed as immutable     println!(&quot;{}&quot;, first_two_bytes_slice); }<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li>\u041d\u0435 \u0437\u0440\u044f \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>&amp;<\/code><\/li>\n<li>the book, \u0440\u0430\u0441\u043a\u0440\u044b\u0432\u0430\u044f \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u043a\u0443\u0445\u043d\u044e, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u0432 \u043e\u0441\u043d\u043e\u0432\u0435 String \u043b\u0435\u0436\u0430\u0442 \u0442\u0440\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (ptr, len, capacity), \u0430 slice \u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0432\u044b\u043c\u0438 \u0434\u0432\u0443\u043c\u044f<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u042f\u0432\u043d\u043e\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u0442\u0438\u043f\u043e\u0432 \u0434\u043b\u044f slice \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e:<\/p>\n<p>  <\/p>\n<pre><code class=\"rust\">fn return_slices(s: &amp;String) -&gt; (&amp;str, &amp;[u8]){     let bytes = s.as_bytes();     return (&amp;s[..], &amp;bytes[..]) }<\/code><\/pre>\n<p>  <\/p>\n<ul>\n<li>\u0421\u0440\u0435\u0437 \u0441\u0442\u0440\u043e\u043a\u0438 \u0438\u043c\u0435\u0435\u0442 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u044b\u0439 \u0442\u0438\u043f <code>&amp;str<\/code><\/li>\n<li>\u0421\u0440\u0435\u0437 \u0434\u043b\u044f as_bytes() \u0438\u043c\u0435\u0435\u0442 \u0442\u0438\u043f <code>&amp;[u8]<\/code>, \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443: &quot;slice type is &amp;[T]&quot;<\/li>\n<\/ul>\n<p>  <\/p>\n<h1 id=\"ssylki\">\u0421\u0441\u044b\u043b\u043a\u0438<\/h1>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/play.rust-lang.org\/?version=stable&amp;mode=debug&amp;edition=2018&amp;gist=043a26f5711780304968eb4c1ad8b98a\" rel=\"nofollow noopener noreferrer\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0437 \u0441\u0442\u0430\u0442\u044c\u0438<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/537790\/\">\u041a\u0430\u043a \u043c\u044b \u0440\u0436\u0430\u0432\u0435\u043b\u0438. \u0418\u0441\u0442\u043e\u0440\u0438\u044f \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0438 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f<\/a><\/li>\n<li><a href=\"https:\/\/doc.rust-lang.org\/book\/ch04-00-understanding-ownership.html\" rel=\"nofollow noopener noreferrer\">Understanding Ownership<\/a> (the book)<\/li>\n<li><a href=\"https:\/\/doc.rust-lang.ru\/book\/ch04-00-understanding-ownership.html\" rel=\"nofollow noopener noreferrer\">\u041f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0432\u043b\u0430\u0434\u0435\u043d\u0438\u044f<\/a><\/li>\n<li><a href=\"https:\/\/fasterthanli.me\/articles\/a-half-hour-to-learn-rust\" rel=\"nofollow noopener noreferrer\">A half-hour to learn Rust<\/a><\/li>\n<\/ul>\n<\/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=\"https:\/\/habr.com\/ru\/post\/566668\/\"> https:\/\/habr.com\/ru\/post\/566668\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\n<p><a href=\"https:\/\/habr.com\/ru\/users\/nurked\/\" class=\"user_link\">Nurked<\/a> <a href=\"https:\/\/habr.com\/ru\/post\/537790\/\">\u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b<\/a> \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u044f <a href=\"https:\/\/doc.rust-lang.org\/book\/title-page.html\" rel=\"nofollow noopener noreferrer\">&quot;the book&quot;<\/a> \u2014 \u0447\u0438\u0442\u0430\u0442\u044c \u0433\u043b\u0430\u0432\u044b \u043d\u0430\u0434\u043e \u043d\u0435 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443, \u0430 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 [4, 3, 5, 6, 8, 4, 9, 7, 10, 4, 13, 17, 15, 16].<\/p>\n<p>  <\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u043f\u043e\u0439\u0442\u0438 \u0434\u0430\u043b\u044c\u0448\u0435. \u041c\u043d\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043b\u0435\u0433\u0447\u0435 \u0438 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0435\u0441\u043b\u0438 \u0432\u044b\u043a\u0438\u043d\u0443\u0442\u044c \u0431\u043e\u0301\u043b\u044c\u0448\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u0430 \u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d &quot;\u043f\u0440\u043e\u0431\u043d\u0438\u043a&quot; \u0432 \u0432\u0438\u0434\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e\u0439 \u0433\u043b\u0430\u0432\u044b 4. \u0427\u0442\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u043f\u044b\u0442\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u2014 \u043e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u0430 &quot;\u0447\u0435\u043c \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0435\u043a \u043e\u0442 \u043a\u0443\u0447\u0438&quot;, \u0435\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u043e\u043f\u0430\u043b\u0438 \u043f\u043e\u0434 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e. <\/p>\n<p>  <\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041b\u0438\u0440\u0438\u043a\u0430<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<p>\u0418\u0437 \u0442\u0435\u0445 \u044f\u0437\u044b\u043a\u043e\u0432, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u044f \u043f\u043b\u043e\u0442\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u043b, Rust \u0431\u043b\u0438\u0436\u0435 \u0432\u0441\u0435\u0433\u043e, \u041a\u041c\u041a, \u043a Go. \u0418\u0445 \u0440\u043e\u0434\u043d\u0438\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 &quot;\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u041e\u041e\u041f&quot;, \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 &quot;\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439&quot;, \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u044f \u0441\u0440\u0435\u0437\u043e\u0432 (slice), \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0442\u0430\u043a \u0438 \u0441\u0441\u044b\u043b\u043e\u043a\/\u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043d\u0430 \u043d\u0438\u0445, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043d\u0443 \u0438, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043a\u0440\u043e\u0441\u0441-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f &quot;\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438&quot;. \u0412 Go \u043f\u043e\u043a\u0430 \u043d\u0435\u0442 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432, \u043d\u043e \u043f\u0440\u043e \u043d\u0438\u0445 \u0437\u043d\u0430\u044e\u0442 \u0438 \u0438\u0445 \u0436\u0434\u0443\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u044b\u0442\u043d\u043e\u0433\u043e \u0433\u043e\u0444\u0435\u0440\u0430 \u0440\u0436\u0430\u0432\u0447\u0438\u043d\u043e\u0439 \u043d\u0435 \u0438\u0441\u043f\u0443\u0433\u0430\u0442\u044c.<\/p>\n<\/div><\/div>\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-326198","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/326198","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=326198"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/326198\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=326198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=326198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=326198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}