{"id":129,"date":"2025-08-21T00:21:03","date_gmt":"2025-08-21T07:21:03","guid":{"rendered":"https:\/\/www.rusttutorial.com\/?page_id=129"},"modified":"2025-08-21T00:24:44","modified_gmt":"2025-08-21T07:24:44","slug":"rust-while-loop","status":"publish","type":"page","link":"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/","title":{"rendered":"Rust While Loop"},"content":{"rendered":"\n<p>In Rust, <a href=\"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-loop\/\">loops<\/a> allows you to run a block of code repeatedly. One of the most common types of loops is the <strong><code>while<\/code> loop<\/strong>, which runs as long as a given condition is <code>true<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='rust-while-loop-syntax'>Rust While Loop Syntax <a href=\"#rust-while-loop-syntax\" class=\"anchor\" id=\"rust-while-loop-syntax\" title=\"Anchor for Rust While Loop Syntax\">#<\/a><\/h2>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"Rust\" data-shcb-language-slug=\"rust\"><span><code class=\"hljs language-rust\"><span class=\"hljs-keyword\">while<\/span> condition {\n    <span class=\"hljs-comment\">\/\/ code to run repeatedly<\/span>\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Rust<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">rust<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<ul class=\"wp-block-list\">\n<li>The <strong>condition<\/strong> must be a <code>bool<\/code> (true\/false).<\/li>\n\n\n\n<li>The block of code runs as long as the condition is <code>true<\/code>.<\/li>\n\n\n\n<li>When the condition becomes <code>false<\/code>, the loop stops.<\/li>\n<\/ul>\n\n\n\n<p>In practice, <code>for<\/code> loops are often cleaner for collections, but <code>while<\/code> is great for more flexible conditions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id='basic-rust-while-loop-example'>Basic Rust While Loop Example <a href=\"#basic-rust-while-loop-example\" class=\"anchor\" id=\"basic-rust-while-loop-example\" title=\"Anchor for Basic Rust While Loop Example\">#<\/a><\/h3>\n\n\n\n<p>The following example illustrates how to use a simple <code>while<\/code> loop:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"Rust\" data-shcb-language-slug=\"rust\"><span><code class=\"hljs language-rust\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">fn<\/span> <span class=\"hljs-title\">main<\/span><\/span>() {\n    <span class=\"hljs-keyword\">let<\/span> <span class=\"hljs-keyword\">mut<\/span> number = <span class=\"hljs-number\">3<\/span>;\n\n    <span class=\"hljs-keyword\">while<\/span> number != <span class=\"hljs-number\">0<\/span> {\n        <span class=\"hljs-built_in\">println!<\/span>(<span class=\"hljs-string\">\"{number}!\"<\/span>);\n\n        number -= <span class=\"hljs-number\">1<\/span>; <span class=\"hljs-comment\">\/\/ decrease number<\/span>\n    }\n\n    <span class=\"hljs-built_in\">println!<\/span>(<span class=\"hljs-string\">\"LIFTOFF!!! \ud83d\ude80\"<\/span>);\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Rust<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">rust<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"Rust\" data-shcb-language-slug=\"rust\"><span><code class=\"hljs language-rust\"><span class=\"hljs-number\">3<\/span>!\n<span class=\"hljs-number\">2<\/span>!\n<span class=\"hljs-number\">1<\/span>!\nLIFTOFF!!! \ud83d\ude80\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Rust<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">rust<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Here:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The loop runs while <code>number != 0<\/code>.<\/li>\n\n\n\n<li>On each iteration, we print the number and subtract <code>1<\/code>.<\/li>\n\n\n\n<li>Once <code>number<\/code> becomes <code>0<\/code>, the condition is false \u2192 the loop stops.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id='infinite-loop'>Infinite Loop <a href=\"#infinite-loop\" class=\"anchor\" id=\"infinite-loop\" title=\"Anchor for Infinite Loop\">#<\/a><\/h2>\n\n\n\n<p>If you <strong>forget to update the condition<\/strong>, your program might run forever. The following example illustrates a program that runs forever due to the infinite loop:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"Rust\" data-shcb-language-slug=\"rust\"><span><code class=\"hljs language-rust\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">fn<\/span> <span class=\"hljs-title\">main<\/span><\/span>() {\n    <span class=\"hljs-keyword\">let<\/span> <span class=\"hljs-keyword\">mut<\/span> x = <span class=\"hljs-number\">5<\/span>;\n\n    <span class=\"hljs-keyword\">while<\/span> x &gt; <span class=\"hljs-number\">0<\/span> {\n        <span class=\"hljs-built_in\">println!<\/span>(<span class=\"hljs-string\">\"x is {x}\"<\/span>);\n        <span class=\"hljs-comment\">\/\/ <span class=\"hljs-doctag\">BUG:<\/span> we forgot to decrease x<\/span>\n    }\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Rust<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">rust<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>This loop will <strong>never end<\/strong>, because <code>x<\/code> always stays <code>5<\/code>. Therefore, you should always make sure the loop condition can become <code>false<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id='using-break-and-continue-in-a-while-loop'>Using break and continue in a while Loop <a href=\"#using-break-and-continue-in-a-while-loop\" class=\"anchor\" id=\"using-break-and-continue-in-a-while-loop\" title=\"Anchor for Using break and continue in a while Loop\">#<\/a><\/h2>\n\n\n\n<p>The <code>while<\/code> loop supports two useful control keywords: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>break<\/code><\/li>\n\n\n\n<li><code>continue<\/code><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id='break-%e2%80%93-exit-the-loop-immediately'><strong>break<\/strong> \u2013 Exit the loop immediately <a href=\"#break-%e2%80%93-exit-the-loop-immediately\" class=\"anchor\" id=\"break-%e2%80%93-exit-the-loop-immediately\" title=\"Anchor for &lt;strong&gt;&lt;code&gt;break&lt;\/code&gt;&lt;\/strong&gt; \u2013 Exit the loop immediately\">#<\/a><\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"Rust\" data-shcb-language-slug=\"rust\"><span><code class=\"hljs language-rust\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">fn<\/span> <span class=\"hljs-title\">main<\/span><\/span>() {\n    <span class=\"hljs-keyword\">let<\/span> <span class=\"hljs-keyword\">mut<\/span> number = <span class=\"hljs-number\">0<\/span>;\n\n    <span class=\"hljs-keyword\">while<\/span> number &lt; <span class=\"hljs-number\">10<\/span> {\n        <span class=\"hljs-keyword\">if<\/span> number == <span class=\"hljs-number\">5<\/span> {\n            <span class=\"hljs-built_in\">println!<\/span>(<span class=\"hljs-string\">\"Reached 5, breaking out of loop.\"<\/span>);\n            <span class=\"hljs-keyword\">break<\/span>; <span class=\"hljs-comment\">\/\/ Exit the loop<\/span>\n        }\n        <span class=\"hljs-built_in\">println!<\/span>(<span class=\"hljs-string\">\"number = {}\"<\/span>, number);\n        number += <span class=\"hljs-number\">1<\/span>;\n    }\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Rust<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">rust<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"Rust\" data-shcb-language-slug=\"rust\"><span><code class=\"hljs language-rust\">number = <span class=\"hljs-number\">0<\/span>\nnumber = <span class=\"hljs-number\">1<\/span>\nnumber = <span class=\"hljs-number\">2<\/span>\nnumber = <span class=\"hljs-number\">3<\/span>\nnumber = <span class=\"hljs-number\">4<\/span>\nReached <span class=\"hljs-number\">5<\/span>, breaking out of <span class=\"hljs-keyword\">loop<\/span>.\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Rust<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">rust<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id='continue-%e2%80%93-skip-to-the-next-iteration'><strong>continue<\/strong> \u2013 Skip to the next iteration <a href=\"#continue-%e2%80%93-skip-to-the-next-iteration\" class=\"anchor\" id=\"continue-%e2%80%93-skip-to-the-next-iteration\" title=\"Anchor for &lt;strong&gt;&lt;code&gt;continue&lt;\/code&gt;&lt;\/strong&gt; \u2013 Skip to the next iteration\">#<\/a><\/h3>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"Rust\" data-shcb-language-slug=\"rust\"><span><code class=\"hljs language-rust\"><span class=\"hljs-function\"><span class=\"hljs-keyword\">fn<\/span> <span class=\"hljs-title\">main<\/span><\/span>() {\n    <span class=\"hljs-keyword\">let<\/span> <span class=\"hljs-keyword\">mut<\/span> number = <span class=\"hljs-number\">0<\/span>;\n\n    <span class=\"hljs-keyword\">while<\/span> number &lt; <span class=\"hljs-number\">5<\/span> {\n        number += <span class=\"hljs-number\">1<\/span>;\n\n        <span class=\"hljs-keyword\">if<\/span> number == <span class=\"hljs-number\">3<\/span> {\n            <span class=\"hljs-built_in\">println!<\/span>(<span class=\"hljs-string\">\"Skipping number 3\"<\/span>);\n            <span class=\"hljs-keyword\">continue<\/span>; <span class=\"hljs-comment\">\/\/ Skip printing 3<\/span>\n        }\n\n        <span class=\"hljs-built_in\">println!<\/span>(<span class=\"hljs-string\">\"number = {}\"<\/span>, number);\n    }\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Rust<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">rust<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<p>Output:<\/p>\n\n\n<pre class=\"wp-block-code\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"Rust\" data-shcb-language-slug=\"rust\"><span><code class=\"hljs language-rust\">number = <span class=\"hljs-number\">1<\/span>\nnumber = <span class=\"hljs-number\">2<\/span>\nSkipping number <span class=\"hljs-number\">3<\/span>\nnumber = <span class=\"hljs-number\">4<\/span>\nnumber = <span class=\"hljs-number\">5<\/span><\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">Rust<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">rust<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n\n\n<h2 class=\"wp-block-heading\" id='summary'>Summary <a href=\"#summary\" class=\"anchor\" id=\"summary\" title=\"Anchor for Summary\">#<\/a><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A <code>while<\/code> loop runs <strong>as long as its condition is true<\/strong>.<\/li>\n\n\n\n<li>Always ensure the condition will eventually become <code>false<\/code> to avoid infinite loops.<\/li>\n\n\n\n<li>You can use <code>while<\/code> for countdowns, condition-based repetition, or manual iteration.<\/li>\n<\/ul>\n<div class=\"helpful-block-content\" data-title=\"\">\n\t<div class=\"wth-question\">Was this Helpful ?<\/div>\n\t<div class=\"wth-thumbs\">\n\t\t<button\n\t\t\tdata-post=\"129\"\n\t\t\tdata-post-url=\"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/\"\n\t\t\tdata-post-title=\"Rust While Loop\"\n\t\t\tdata-response=\"1\"\n\t\t\tclass=\"wth-btn-rounded wth-yes-btn\"\n\t\t>\n\t\t\t<svg\n\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstroke-width=\"2\"\n\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t\tclass=\"feather feather-thumbs-up block w-full h-full\"\n\t\t\t>\n\t\t\t\t<path\n\t\t\t\t\td=\"M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3\"\n\t\t\t\t><\/path>\n\t\t\t<\/svg>\n\t\t\t<span class=\"sr-only\"> Yes <\/span>\n\t\t<\/button>\n\n\t\t<button\n\t\t\tdata-response=\"0\"\n\t\t\tdata-post=\"129\"\n\t\t\tdata-post-url=\"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/\"\n\t\t\tdata-post-title=\"Rust While Loop\"\n\t\t\tclass=\"wth-btn-rounded wth-no-btn\"\n\t\t>\n\t\t\t<svg\n\t\t\t\txmlns=\"http:\/\/www.w3.org\/2000\/svg\"\n\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\tfill=\"none\"\n\t\t\t\tstroke=\"currentColor\"\n\t\t\t\tstroke-width=\"2\"\n\t\t\t\tstroke-linecap=\"round\"\n\t\t\t\tstroke-linejoin=\"round\"\n\t\t\t>\n\t\t\t\t<path\n\t\t\t\t\td=\"M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17\"\n\t\t\t\t><\/path>\n\t\t\t<\/svg>\n\t\t\t<span class=\"sr-only\"> No <\/span>\n\t\t<\/button>\n\t<\/div>\n\n\t<div class=\"wth-form hidden\">\n\t\t<div class=\"wth-form-wrapper\">\n\t\t\t<div class=\"wth-title\"><\/div>\n\t\t\t<textarea class=\"wth-message\"><\/textarea>\n\t\t\t<input type=\"button\" name=\"wth-submit\" class=\"wth-btn wth-btn-submit\" id=\"wth-submit\" \/>\n\t\t\t<input type=\"button\" class=\"wth-btn wth-btn-cancel\" value=\"Cancel\" \/>\n\t\t<\/div>\n\t<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you&#8217;ll learn about Rust while loop, which runs as long as a given condition is true.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":9,"menu_order":11,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-129","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Rust While Loop<\/title>\n<meta name=\"description\" content=\"In this tutorial, you&#039;ll learn about Rust while loop, which runs as long as a given condition is true.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Rust While Loop\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, you&#039;ll learn about Rust while loop, which runs as long as a given condition is true.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/\" \/>\n<meta property=\"og:site_name\" content=\"Rust Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-21T07:24:44+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/\",\"url\":\"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/\",\"name\":\"Rust While Loop\",\"isPartOf\":{\"@id\":\"https:\/\/www.rusttutorial.com\/#website\"},\"datePublished\":\"2025-08-21T07:21:03+00:00\",\"dateModified\":\"2025-08-21T07:24:44+00:00\",\"description\":\"In this tutorial, you'll learn about Rust while loop, which runs as long as a given condition is true.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.rusttutorial.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Rust Tutorial\",\"item\":\"https:\/\/www.rusttutorial.com\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Rust While Loop\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.rusttutorial.com\/#website\",\"url\":\"https:\/\/www.rusttutorial.com\/\",\"name\":\"Rust Tutorial\",\"description\":\"Learn Rust Programming from Scratch\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.rusttutorial.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Rust While Loop","description":"In this tutorial, you'll learn about Rust while loop, which runs as long as a given condition is true.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/","og_locale":"en_US","og_type":"article","og_title":"Rust While Loop","og_description":"In this tutorial, you'll learn about Rust while loop, which runs as long as a given condition is true.","og_url":"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/","og_site_name":"Rust Tutorial","article_modified_time":"2025-08-21T07:24:44+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/","url":"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/","name":"Rust While Loop","isPartOf":{"@id":"https:\/\/www.rusttutorial.com\/#website"},"datePublished":"2025-08-21T07:21:03+00:00","dateModified":"2025-08-21T07:24:44+00:00","description":"In this tutorial, you'll learn about Rust while loop, which runs as long as a given condition is true.","breadcrumb":{"@id":"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.rusttutorial.com\/rust-tutorial\/rust-while-loop\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rusttutorial.com\/"},{"@type":"ListItem","position":2,"name":"Rust Tutorial","item":"https:\/\/www.rusttutorial.com\/"},{"@type":"ListItem","position":3,"name":"Rust While Loop"}]},{"@type":"WebSite","@id":"https:\/\/www.rusttutorial.com\/#website","url":"https:\/\/www.rusttutorial.com\/","name":"Rust Tutorial","description":"Learn Rust Programming from Scratch","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rusttutorial.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.rusttutorial.com\/wp-json\/wp\/v2\/pages\/129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rusttutorial.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.rusttutorial.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.rusttutorial.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rusttutorial.com\/wp-json\/wp\/v2\/comments?post=129"}],"version-history":[{"count":4,"href":"https:\/\/www.rusttutorial.com\/wp-json\/wp\/v2\/pages\/129\/revisions"}],"predecessor-version":[{"id":134,"href":"https:\/\/www.rusttutorial.com\/wp-json\/wp\/v2\/pages\/129\/revisions\/134"}],"up":[{"embeddable":true,"href":"https:\/\/www.rusttutorial.com\/wp-json\/wp\/v2\/pages\/9"}],"wp:attachment":[{"href":"https:\/\/www.rusttutorial.com\/wp-json\/wp\/v2\/media?parent=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}