{"id":1268,"date":"2024-08-12T22:38:28","date_gmt":"2024-08-12T14:38:28","guid":{"rendered":"https:\/\/www.fanyamin.com\/wordpress\/?p=1268"},"modified":"2024-08-12T23:06:04","modified_gmt":"2024-08-12T15:06:04","slug":"rust-first-step","status":"publish","type":"post","link":"https:\/\/www.fanyamin.com\/wordpress\/?p=1268","title":{"rendered":"rust first step"},"content":{"rendered":"<h2>installation<\/h2>\n<pre><code>curl --proto &#039;=https&#039; --tlsv1.2 -sSf https:\/\/sh.rustup.rs | sh<\/code><\/pre>\n<h2>Cargo<\/h2>\n<p>Cargo: the Rust build tool and package manager<br \/>\nWhen you install Rustup you\u2019ll also get the latest stable version of the Rust build tool and package manager, also known as Cargo. Cargo does lots of things:<\/p>\n<ul>\n<li>build your project with <code>cargo build<\/code><\/li>\n<li>run your project with <code>cargo run<\/code><\/li>\n<li>test your project with <code>cargo test<\/code><\/li>\n<li>build documentation for your project with <code>cargo doc<\/code><\/li>\n<li>publish a library to crates.io with <code>cargo publish<\/code><\/li>\n<\/ul>\n<p>To test that you have Rust and Cargo installed, you can run this in your terminal of choice:<\/p>\n<p><code>cargo --version<\/code><\/p>\n<h2>Example<\/h2>\n<pre><code>fn main() {\n    println!(&quot;Hello, world!&quot;);\n}<\/code><\/pre>\n<ul>\n<li>build<\/li>\n<\/ul>\n<pre><code>$ rustc main.rs\n$ .\/main\nHello, world!<\/code><\/pre>\n<p>or<\/p>\n<pre><code>cargo new hello_cargo\ncd hello_cargo\ncargo build\ncargo run\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>installation curl &#8211;proto &#039;=https&#039; &#8211;tlsv1.2 -sSf https:\/\/sh.rustup.rs | sh Cargo Cargo: the Rust build tool and package manager When you install Rustup you\u2019ll also get the latest stable version of the Rust build tool and package manager, also known as Cargo. Cargo does lots of things: build your project with cargo build run your project [&hellip;] <a class=\"read-more\" href=\"https:\/\/www.fanyamin.com\/wordpress\/?p=1268\" title=\"Permanent Link to: rust first step\">&rarr;Read&nbsp;more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-1268","post","type-post","status-publish","format-standard","hentry","category-5"],"_links":{"self":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1268"}],"collection":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1268"}],"version-history":[{"count":4,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1268\/revisions"}],"predecessor-version":[{"id":1274,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1268\/revisions\/1274"}],"wp:attachment":[{"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fanyamin.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}