"use strict";function playground_text(e){let t=e.querySelector("code");if(window.ace&&t.classList.contains("editable")){return window.ace.edit(t).getValue()}return t.textContent}window.onunload=function(){},function(){function e(e,t,n=2e4){return Promise.race([fetch(e,t),new Promise(((e,t)=>setTimeout((()=>t(new Error("timeout"))),n)))])}var t=Array.from(document.querySelectorAll(".playground"));function n(e,t){var n=e.querySelector(".play-button");if(e.querySelector("code").classList.contains("no_run"))n.classList.add("hidden");else{for(var r,i=playground_text(e),o=/extern\s+crate\s+([a-zA-Z_0-9]+)\s*;/g,a=[];r=o.exec(i);)a.push(r[1]);a.every((function(e){return t.indexOf(e)>-1}))?n.classList.remove("hidden"):n.classList.add("hidden")}}function r(t){var n=t.querySelector(".result");n||((n=document.createElement("code")).className="result hljs language-bash",t.append(n));let r=playground_text(t),i=t.querySelector("code").classList,o="2015";i.contains("edition2018")?o="2018":i.contains("edition2021")&&(o="2021");var a={version:"stable",optimize:"0",code:r,edition:o};-1!==r.indexOf("#![feature")&&(a.version="nightly"),n.innerText="Running...",e("https://play.rust-lang.org/evaluate.json",{headers:{"Content-Type":"application/json"},method:"POST",mode:"cors",body:JSON.stringify(a)}).then((e=>e.json())).then((e=>{""===e.result.trim()?(n.innerText="No output",n.classList.add("result-no-output")):(n.innerText=e.result,n.classList.remove("result-no-output"))})).catch((e=>n.innerText="Playground Communication: "+e.message))}t.length>0&&e("https://play.rust-lang.org/meta/crates",{headers:{"Content-Type":"application/json"},method:"POST",mode:"cors"}).then((e=>e.json())).then((e=>{let i=e.crates.map((e=>e.id));t.forEach((e=>function(e,t){if(n(e,t),window.ace){let i=e.querySelector("code");if(i.classList.contains("editable")){let o=window.ace.edit(i);o.addEventListener("change",(function(r){n(e,t)})),o.commands.addCommand({name:"run",bindKey:{win:"Ctrl-Enter",mac:"Ctrl-Enter"},exec:t=>r(e)})}}}(e,i)))})),hljs.configure({tabReplace:" ",languages:[]});let i=Array.from(document.querySelectorAll("code")).filter((function(e){return!e.parentElement.classList.contains("header")}));window.ace?(i.filter((function(e){return e.classList.contains("editable")})).forEach((function(e){e.classList.remove("language-rust")})),i.filter((function(e){return!e.classList.contains("editable")})).forEach((function(e){hljs.highlightBlock(e)}))):i.forEach((function(e){hljs.highlightBlock(e)})),i.forEach((function(e){e.classList.add("hljs")})),Array.from(document.querySelectorAll("code.language-rust")).forEach((function(e){if(Array.from(e.querySelectorAll(".boring")).length){e.classList.add("hide-boring");var t=document.createElement("div");t.className="buttons",t.innerHTML='';var n=e.parentNode;n.insertBefore(t,n.firstChild),n.querySelector(".buttons").addEventListener("click",(function(t){t.target.classList.contains("fa-eye")?(t.target.classList.remove("fa-eye"),t.target.classList.add("fa-eye-slash"),t.target.title="Hide lines",t.target.setAttribute("aria-label",t.target.title),e.classList.remove("hide-boring")):t.target.classList.contains("fa-eye-slash")&&(t.target.classList.remove("fa-eye-slash"),t.target.classList.add("fa-eye"),t.target.title="Show hidden lines",t.target.setAttribute("aria-label",t.target.title),e.classList.add("hide-boring"))}))}})),window.playground_copyable&&Array.from(document.querySelectorAll("pre code")).forEach((function(e){var t=e.parentNode;if(!t.classList.contains("playground")){var n=t.querySelector(".buttons");n||((n=document.createElement("div")).className="buttons",t.insertBefore(n,t.firstChild));var r=document.createElement("button");r.className="fa fa-copy clip-button",r.title="Copy to clipboard",r.setAttribute("aria-label",r.title),r.innerHTML='',n.insertBefore(r,n.firstChild)}})),Array.from(document.querySelectorAll(".playground")).forEach((function(e){var t=e.querySelector(".buttons");t||((t=document.createElement("div")).className="buttons",e.insertBefore(t,e.firstChild));var n=document.createElement("button");if(n.className="fa fa-play play-button",n.hidden=!0,n.title="Run this code",n.setAttribute("aria-label",n.title),t.insertBefore(n,t.firstChild),n.addEventListener("click",(function(t){r(e)})),window.playground_copyable){var i=document.createElement("button");i.className="fa fa-copy clip-button",i.innerHTML='',i.title="Copy to clipboard",i.setAttribute("aria-label",i.title),t.insertBefore(i,t.firstChild)}let o=e.querySelector("code");if(window.ace&&o.classList.contains("editable")){var a=document.createElement("button");a.className="fa fa-history reset-button",a.title="Undo changes",a.setAttribute("aria-label",a.title),t.insertBefore(a,t.firstChild),a.addEventListener("click",(function(){let e=window.ace.edit(o);e.setValue(e.originalCode),e.clearSelection()}))}}))}(),function(){var e=document.querySelector("html"),t=document.getElementById("theme-toggle"),n=document.getElementById("theme-list"),r=document.querySelector('meta[name="theme-color"]'),i={ayuHighlight:document.querySelector("[href$='ayu-highlight.css']"),tomorrowNight:document.querySelector("[href$='tomorrow-night.css']"),highlight:document.querySelector("[href$='highlight.css']")};function o(){n.style.display="none",t.setAttribute("aria-expanded",!1),t.focus()}function a(){var e;try{e=localStorage.getItem("mdbook-theme")}catch(e){}return null==e?default_theme:e}function s(t,n=!0){let o;"coal"==t||"navy"==t?(i.ayuHighlight.disabled=!0,i.tomorrowNight.disabled=!1,i.highlight.disabled=!0,o="ace/theme/tomorrow_night"):"ayu"==t?(i.ayuHighlight.disabled=!1,i.tomorrowNight.disabled=!0,i.highlight.disabled=!0,o="ace/theme/tomorrow_night"):(i.ayuHighlight.disabled=!0,i.tomorrowNight.disabled=!0,i.highlight.disabled=!1,o="ace/theme/dawn"),setTimeout((function(){r.content=getComputedStyle(document.body).backgroundColor}),1),window.ace&&window.editors&&window.editors.forEach((function(e){e.setTheme(o)}));var s=a();if(n)try{localStorage.setItem("mdbook-theme",t)}catch(e){}e.classList.remove(s),e.classList.add(t)}s(a(),!1),t.addEventListener("click",(function(){"block"===n.style.display?o():(n.style.display="block",t.setAttribute("aria-expanded",!0),n.querySelector("button#"+a()).focus())})),n.addEventListener("click",(function(e){var t;if("theme"===e.target.className)t=e.target.id;else{if("theme"!==e.target.parentElement.className)return;t=e.target.parentElement.id}s(t)})),n.addEventListener("focusout",(function(e){!e.relatedTarget||t.contains(e.relatedTarget)||n.contains(e.relatedTarget)||o()})),document.addEventListener("click",(function(e){"block"!==n.style.display||t.contains(e.target)||n.contains(e.target)||o()})),document.addEventListener("keydown",(function(e){if(!(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)&&n.contains(e.target))switch(e.key){case"Escape":e.preventDefault(),o();break;case"ArrowUp":e.preventDefault(),(t=document.activeElement.parentElement)&&t.previousElementSibling&&t.previousElementSibling.querySelector("button").focus();break;case"ArrowDown":var t;e.preventDefault(),(t=document.activeElement.parentElement)&&t.nextElementSibling&&t.nextElementSibling.querySelector("button").focus();break;case"Home":e.preventDefault(),n.querySelector("li:first-child button").focus();break;case"End":e.preventDefault(),n.querySelector("li:last-child button").focus()}}))}(),function(){var e=document.querySelector("html"),t=document.getElementById("sidebar"),n=document.querySelectorAll("#sidebar a"),r=document.getElementById("sidebar-toggle"),i=document.getElementById("sidebar-resize-handle"),o=null;function a(){e.classList.remove("sidebar-hidden"),e.classList.add("sidebar-visible"),Array.from(n).forEach((function(e){e.setAttribute("tabIndex",0)})),r.setAttribute("aria-expanded",!0),t.setAttribute("aria-hidden",!1);try{localStorage.setItem("mdbook-sidebar","visible")}catch(e){}}var s=document.querySelectorAll("#sidebar a.toggle");function l(e){e.currentTarget.parentElement.classList.toggle("expanded")}function c(){e.classList.remove("sidebar-visible"),e.classList.add("sidebar-hidden"),Array.from(n).forEach((function(e){e.setAttribute("tabIndex",-1)})),r.setAttribute("aria-expanded",!1),t.setAttribute("aria-hidden",!0);try{localStorage.setItem("mdbook-sidebar","hidden")}catch(e){}}function d(n){var r=n.clientX-t.offsetLeft;r<20?c():(e.classList.contains("sidebar-hidden")&&a(),r=Math.min(r,window.innerWidth-100),document.documentElement.style.setProperty("--sidebar-width",r+"px"))}function u(t){e.classList.remove("sidebar-resizing"),window.removeEventListener("mousemove",d,!1),window.removeEventListener("mouseup",u,!1)}Array.from(s).forEach((function(e){e.addEventListener("click",l)})),r.addEventListener("click",(function(){e.classList.contains("sidebar-hidden")?(parseInt(document.documentElement.style.getPropertyValue("--sidebar-width"),10)<150&&document.documentElement.style.setProperty("--sidebar-width","150px"),a()):e.classList.contains("sidebar-visible")||"none"===getComputedStyle(t).transform?c():a()})),i.addEventListener("mousedown",(function(t){window.addEventListener("mousemove",d,!1),window.addEventListener("mouseup",u,!1),e.classList.add("sidebar-resizing")}),!1),document.addEventListener("touchstart",(function(e){o={x:e.touches[0].clientX,time:Date.now()}}),{passive:!0}),document.addEventListener("touchmove",(function(e){if(o){var t=e.touches[0].clientX,n=t-o.x;Date.now()-o.time<250&&Math.abs(n)>=150&&(n>=0&&o.xn?(a=!1,l>0&&(s=n)):l>0?a=!0:l