if(!String.prototype.startsWith){String.prototype.startsWith=function(searchString,position){position=position||0;return this.indexOf(searchString,position)===position;};}if(!String.prototype.endsWith){String.prototype.endsWith=function(suffix,length){var l=length||this.length;return this.indexOf(suffix,l-suffix.length)!==-1;};}if(!DOMTokenList.prototype.add){DOMTokenList.prototype.add=function(className){if(className&&!hasClass(this,className)){if(this.className&&this.className.length>0){this.className+=" "+className;}else{this.className=className;}}};}if(!DOMTokenList.prototype.remove){DOMTokenList.prototype.remove=function(className){if(className&&this.className){this.className=(" "+this.className+" ").replace(" "+className+" "," ").trim();}};}(function(){"use strict";var itemTypes=["mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","primitive","associatedtype","constant","associatedconstant","union","foreigntype","keyword","existential","attr","derive","traitalias"];var search_input=document.getElementsByClassName("search-input")[0];var currentTab=0;var titleBeforeSearch=document.title;function getPageId(){var id=document.location.href.split("#")[1];if(id){return id.split("?")[0].split("&")[0];}return null;}function showSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){addClass(elems,"show-it");}var sidebar=document.getElementsByClassName("sidebar")[0];if(sidebar){addClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(!filler){var div=document.createElement("div");div.id="sidebar-filler";sidebar.appendChild(div);}}var themePicker=document.getElementsByClassName("theme-picker");if(themePicker&&themePicker.length>0){themePicker[0].style.display="none";}}function hideSidebar(){var elems=document.getElementsByClassName("sidebar-elems")[0];if(elems){removeClass(elems,"show-it");}var sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"mobile");var filler=document.getElementById("sidebar-filler");if(filler){filler.remove();}document.getElementsByTagName("body")[0].style.marginTop="";var themePicker=document.getElementsByClassName("theme-picker");if(themePicker&&themePicker.length>0){themePicker[0].style.display=null;}}var TY_PRIMITIVE=itemTypes.indexOf("primitive");var TY_KEYWORD=itemTypes.indexOf("keyword");onEachLazy(document.getElementsByClassName("js-only"),function(e){removeClass(e,"js-only");});function getQueryStringParams(){var params={};window.location.search.substring(1).split("&").map(function(s){var pair=s.split("=");params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1]);});return params;}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function";}var main=document.getElementById("main");function highlightSourceLines(ev){hideSidebar();var elem;var search=document.getElementById("search");var i,from,to,match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/);if(match){from=parseInt(match[1],10);to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10);}if(to0){collapseDocs(collapses[0],"show");}}}}highlightSourceLines(null);window.onhashchange=highlightSourceLines;function getVirtualKey(ev){if("key"in ev&&typeof ev.key!="undefined"){return ev.key;}var c=ev.charCode||ev.keyCode;if(c==27){return"Escape";}return String.fromCharCode(c);}function displayHelp(display,ev,help){if(display===true){if(hasClass(help,"hidden")){ev.preventDefault();removeClass(help,"hidden");addClass(document.body,"blur");}}else if(hasClass(help,"hidden")===false){ev.preventDefault();addClass(help,"hidden");removeClass(document.body,"blur");}}function handleEscape(ev,help){hideModal();var search=document.getElementById("search");if(hasClass(help,"hidden")===false){displayHelp(false,ev,help);}else if(hasClass(search,"hidden")===false){ev.preventDefault();addClass(search,"hidden");removeClass(main,"hidden");document.title=titleBeforeSearch;}defocusSearchBar();}function handleShortcut(ev){if(ev.ctrlKey||ev.altKey||ev.metaKey){return;}var help=document.getElementById("help");if(document.activeElement.tagName==="INPUT"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev,help);break;}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev,help);break;case"s":case"S":displayHelp(false,ev,help);hideModal();ev.preventDefault();focusSearchBar();break;case"+":case"-":ev.preventDefault();toggleAllDocs();break;case"?":if(ev.shiftKey){hideModal();displayHelp(true,ev,help);}break;}}}function findParentElement(elem,tagName){do{if(elem&&elem.tagName===tagName){return elem;}elem=elem.parentNode;}while(elem);return null;}document.onkeypress=handleShortcut;document.onkeydown=handleShortcut;document.onclick=function(ev){if(hasClass(ev.target,"collapse-toggle")){collapseDocs(ev.target,"toggle");}else if(hasClass(ev.target.parentNode,"collapse-toggle")){collapseDocs(ev.target.parentNode,"toggle");}else if(ev.target.tagName==="SPAN"&&hasClass(ev.target.parentNode,"line-numbers")){var prev_id=0;var set_fragment=function(name){if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);window.hashchange();}else{location.replace("#"+name);}};var cur_id=parseInt(ev.target.id,10);if(ev.shiftKey&&prev_id){if(prev_id>cur_id){var tmp=prev_id;prev_id=cur_id;cur_id=tmp;}set_fragment(prev_id+"-"+cur_id);}else{prev_id=cur_id;set_fragment(cur_id);}}else if(hasClass(document.getElementById("help"),"hidden")===false){addClass(document.getElementById("help"),"hidden");removeClass(document.body,"blur");}else{var a=findParentElement(ev.target,"A");if(a&&a.hash){expandSection(a.hash.replace(/^#/,""));}}};var x=document.getElementsByClassName("version-selector");if(x.length>0){x[0].onchange=function(){var i,match,url=document.location.href,stripped="",len=rootPath.match(/\.\.\//g).length+1;for(i=0;i-1){var obj=searchIndex[results[i].id];obj.lev=results[i].lev;if(isType!==true||obj.type){var res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break;}}}}return out;}function sortResults(results,isType){var ar=[];for(var entry in results){if(results.hasOwnProperty(entry)){ar.push(results[entry]);}}results=ar;var i;var nresults=results.length;for(i=0;ib?+1:-1);}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b;}a=aaa.index;b=bbb.index;if(a!==b){return a-b;}if((aaa.item.ty===TY_PRIMITIVE&&bbb.item.ty!==TY_KEYWORD)||(aaa.item.ty===TY_KEYWORD&&bbb.item.ty!==TY_PRIMITIVE)){return-1;}if((bbb.item.ty===TY_PRIMITIVE&&aaa.item.ty!==TY_PRIMITIVE)||(bbb.item.ty===TY_KEYWORD&&aaa.item.ty!==TY_KEYWORD)){return 1;}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b;}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b;}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1);}return 0;});var length=results.length;for(i=0;i"));return{name:val.substring(0,val.indexOf("<")),generics:values.split(/\s*,\s*/),};}return{name:val,generics:[],};}function checkGenerics(obj,val){var lev_distance=MAX_LEV_DISTANCE+1;if(val.generics.length>0){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>=val.generics.length){var elems=obj[GENERICS_DATA].slice(0);var total=0;var done=0;var vlength=val.generics.length;for(var y=0;yGENERICS_DATA&&obj[GENERICS_DATA].length>=val.generics.length){var elems=obj[GENERICS_DATA].slice(0);var allFound=true;for(var y=0;allFound===true&&yGENERICS_DATA&&obj[GENERICS_DATA].length!==0){var tmp_lev=checkGenerics(obj,val);if(tmp_lev<=MAX_LEV_DISTANCE){return tmp_lev;}}else{return 0;}}if(literalSearch===true){if(obj.length>GENERICS_DATA&&obj[GENERICS_DATA].length>0){var length=obj[GENERICS_DATA].length;for(x=0;x GENERICS_DATA && obj[GENERICS_DATA].length > 0) { // We can check if the type we're looking for is inside the generics! var olength = obj[GENERICS_DATA].length; for (x = 0; x < olength; ++x) { lev_distance = Math.min(levenshtein(obj[GENERICS_DATA][x], val.name), lev_distance); } } // Now whatever happens, the returned distance is "less good" so we should mark it // as such, and so we add 1 to the distance to make it "less good". return lev_distance + 1; } function findArg(obj, val, literalSearch) { var lev_distance = MAX_LEV_DISTANCE + 1; if (obj && obj.type && obj.type[INPUTS_DATA] && obj.type[INPUTS_DATA].length > 0) { var length = obj.type[INPUTS_DATA].length; for (var i = 0; i < length; i++) { var tmp = checkType(obj.type[INPUTS_DATA][i], val, literalSearch); if (literalSearch === true && tmp === true) { return true; } lev_distance = Math.min(tmp, lev_distance); if (lev_distance === 0) { return 0; } } } return literalSearch === true ? false : lev_distance; } function checkReturned(obj, val, literalSearch) { var lev_distance = MAX_LEV_DISTANCE + 1; if (obj && obj.type && obj.type.length > OUTPUT_DATA) { var ret = obj.type[OUTPUT_DATA]; if (!obj.type[OUTPUT_DATA].length) { ret = [ret]; } for (var x = 0; x < ret.length; ++x) { var r = ret[x]; if (typeof r === "string") { r = [r]; } var tmp = checkType(r, val, literalSearch); if (literalSearch === true) { if (tmp === true) { return true; } continue; } lev_distance = Math.min(tmp, lev_distance); if (lev_distance === 0) { return 0; } } } return literalSearch === true ? false : lev_distance; } function checkPath(contains, lastElem, ty) { if (contains.length === 0) { return 0; } var ret_lev = MAX_LEV_DISTANCE + 1; var path = ty.path.split("::"); if (ty.parent && ty.parent.name) { path.push(ty.parent.name.toLowerCase()); } var length = path.length; var clength = contains.length; if (clength > length) { return MAX_LEV_DISTANCE + 1; } for (var i = 0; i < length; ++i) { if (i + clength > length) { break; } var lev_total = 0; var aborted = false; for (var x = 0; x < clength; ++x) { var lev = levenshtein(path[i + x], contains[x]); if (lev > MAX_LEV_DISTANCE) { aborted = true; break; } lev_total += lev; } if (aborted === false) { ret_lev = Math.min(ret_lev, Math.round(lev_total /clength));}}return ret_lev;}function typePassesFilter(filter,type){if(filter<0)return true;if(filter===type)return true;var name=itemTypes[type];switch(itemTypes[filter]){case"constant":return(name=="associatedconstant");case"fn":return(name=="method"||name=="tymethod");case"type":return(name=="primitive"||name=="keyword");}return false;}function generateId(ty){if(ty.parent&&ty.parent.name){return itemTypes[ty.ty]+ty.path+ty.parent.name+ty.name;}return itemTypes[ty.ty]+ty.path+ty.name;}var nSearchWords=searchWords.length;var i;var ty;var fullId;var returned;var in_args;if((val.charAt(0)==="\""||val.charAt(0)==="'")&&val.charAt(val.length-1)===val.charAt(0)){val=extractGenerics(val.substr(1,val.length-2));for(i=0;i")>-1){var trimmer=function(s){return s.trim();};var parts=val.split("->").map(trimmer);var input=parts[0];var inputs=input.split(",").map(trimmer).sort();for(i=0;iOUTPUT_DATA?type[OUTPUT_DATA].name:"";returned=checkReturned(ty,output,true);if(output.name==="*"||returned===true){in_args=false;var is_module=false;if(input==="*"){is_module=true;}else{var allFound=true;for(var it=0;allFound===true&&it1?paths.length-1:1);for(j=0;j1){lev=checkPath(contains,paths[paths.length-1],ty);if(lev>MAX_LEV_DISTANCE){continue;}else if(lev>0){lev_add=1;}}returned=MAX_LEV_DISTANCE+1;in_args=MAX_LEV_DISTANCE+1;var index=-1;lev=MAX_LEV_DISTANCE+1;fullId=generateId(ty);if(searchWords[j].indexOf(split[i])>-1||searchWords[j].indexOf(val)>-1||searchWords[j].replace(/_/g,"").indexOf(val)>-1){if(typePassesFilter(typeFilter,ty.ty)&&results[fullId]===undefined){index=searchWords[j].replace(/_/g,"").indexOf(val);}}if((lev=levenshtein(searchWords[j],val))<=MAX_LEV_DISTANCE){if(typePassesFilter(typeFilter,ty.ty)===false){lev=MAX_LEV_DISTANCE+1;}else{lev+=1;}}if((in_args=findArg(ty,valGenerics))<=MAX_LEV_DISTANCE){if(typePassesFilter(typeFilter,ty.ty)===false){in_args=MAX_LEV_DISTANCE+1;}}if((returned=checkReturned(ty,valGenerics))<=MAX_LEV_DISTANCE){if(typePassesFilter(typeFilter,ty.ty)===false){returned=MAX_LEV_DISTANCE+1;}}lev+=lev_add;if(lev>0&&val.length>3&&searchWords[j].indexOf(val)>-1){if(val.length<6){lev-=1;}else{lev=0;}}if(in_args<=MAX_LEV_DISTANCE){if(results_in_args[fullId]===undefined){results_in_args[fullId]={id:j,index:index,lev:in_args,};}results_in_args[fullId].lev=Math.min(results_in_args[fullId].lev,in_args);}if(returned<=MAX_LEV_DISTANCE){if(results_returned[fullId]===undefined){results_returned[fullId]={id:j,index:index,lev:returned,};}results_returned[fullId].lev=Math.min(results_returned[fullId].lev,returned);}if(index!==-1||lev<=MAX_LEV_DISTANCE){if(index!==-1&&paths.length<2){lev=0;}else if(searchWords[j]===val){lev=-1;}if(results[fullId]===undefined){results[fullId]={id:j,index:index,lev:lev,};}results[fullId].lev=Math.min(results[fullId].lev,lev);}}}var ret={"in_args":sortResults(results_in_args,true),"returned":sortResults(results_returned,true),"others":sortResults(results),};if(ALIASES&&ALIASES[window.currentCrate]&&ALIASES[window.currentCrate][query.raw]){var aliases=ALIASES[window.currentCrate][query.raw];for(i=0;iMAX_RESULTS){ret.others.pop();}}}return ret;}function validateResult(name,path,keys,parent){for(var i=0;i-1||path.indexOf(keys[i])>-1||(parent!==undefined&&parent.name.toLowerCase().indexOf(keys[i])>-1)||levenshtein(name,keys[i])<=MAX_LEV_DISTANCE)){return false;}}return true;}function getQuery(raw){var matches,type,query;query=raw;matches=query.match(/^(fn|mod|struct|enum|trait|type|const|macro)\s*:\s*/i);if(matches){type=matches[1].replace(/^const$/,"constant");query=query.substring(matches[0].length);}return{raw:raw,query:query,type:type,id:query+type};}function initSearchNav(){var hoverTimeout;var click_func=function(e){var el=e.target;while(el.tagName!=="TR"){el=el.parentNode;}var dst=e.target.getElementsByTagName("a");if(dst.length<1){return;}dst=dst[0];if(window.location.pathname===dst.pathname){addClass(document.getElementById("search"),"hidden");removeClass(main,"hidden");document.location.href=dst.href;}};var mouseover_func=function(e){var el=e.target;while(el.tagName!=="TR"){el=el.parentNode;}clearTimeout(hoverTimeout);hoverTimeout=setTimeout(function(){onEachLazy(document.getElementsByClassName("search-results"),function(e){onEachLazy(e.getElementsByClassName("result"),function(i_e){removeClass(i_e,"highlighted");});});addClass(el,"highlighted");},20);};onEachLazy(document.getElementsByClassName("search-results"),function(e){onEachLazy(e.getElementsByClassName("result"),function(i_e){i_e.onclick=click_func;i_e.onmouseover=mouseover_func;});});search_input.onkeydown=function(e){var actives=[[],[],[]];var current=0;onEachLazy(document.getElementById("results").childNodes,function(e){onEachLazy(e.getElementsByClassName("highlighted"),function(e){actives[current].push(e);});current+=1;});if(e.which===38){if(!actives[currentTab].length||!actives[currentTab][0].previousElementSibling){return;}addClass(actives[currentTab][0].previousElementSibling,"highlighted");removeClass(actives[currentTab][0],"highlighted");}else if(e.which===40){if(!actives[currentTab].length){var results=document.getElementById("results").childNodes;if(results.length>0){var res=results[currentTab].getElementsByClassName("result");if(res.length>0){addClass(res[0],"highlighted");}}}else if(actives[currentTab][0].nextElementSibling){addClass(actives[currentTab][0].nextElementSibling,"highlighted");removeClass(actives[currentTab][0],"highlighted");}}else if(e.which===13){if(actives[currentTab].length){document.location.href=actives[currentTab][0].getElementsByTagName("a")[0].href;}}else if(e.which===9){if(e.shiftKey){printTab(currentTab>0?currentTab-1:2);}else{printTab(currentTab>1?0:currentTab+1);}e.preventDefault();}else if(e.which===16){}else if(e.which===27){removeClass(actives[currentTab][0],"highlighted");search_input.value="";defocusSearchBar();}else if(actives[currentTab].length>0){removeClass(actives[currentTab][0],"highlighted");}};}function buildHrefAndPath(item){var displayPath;var href;var type=itemTypes[item.ty];var name=item.name;if(type==="mod"){displayPath=item.path+"::";href=rootPath+item.path.replace(/::/g,"/")+"/"+name+"/index.html";}else if(type==="primitive"||type==="keyword"){displayPath="";href=rootPath+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html";}else if(type==="externcrate"){displayPath="";href=rootPath+name+"/index.html";}else if(item.parent!==undefined){var myparent=item.parent;var anchor="#"+type+"."+name;var parentType=itemTypes[myparent.ty];if(parentType==="primitive"){displayPath=myparent.name+"::";}else{displayPath=item.path+"::"+myparent.name+"::";}href=rootPath+item.path.replace(/::/g,"/")+"/"+parentType+"."+myparent.name+".html"+anchor;}else{displayPath=item.path+"::";href=rootPath+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html";}return[displayPath,href];}function escape(content){var h1=document.createElement("h1");h1.textContent=content;return h1.innerHTML;}function pathSplitter(path){var tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6);}return tmp;}function addTab(array,query,display){var extraStyle="";if(display===false){extraStyle=" style=\"display: none;\"";}var output="";var duplicates={};var length=0;if(array.length>0){output="";array.forEach(function(item){var name,type;name=item.name;type=itemTypes[item.ty];if(item.is_alias!==true){if(duplicates[item.fullPath]){return;}duplicates[item.fullPath]=true;}length+=1;output+="";});output+="
"+""+(item.is_alias===true?(""+item.alias+"  - see "):"")+item.displayPath+""+name+""+""+""+escape(item.desc)+" 
";}else{output="
No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:
";}return[output,length];}function makeTabHeader(tabNb,text,nbElems){if(currentTab===tabNb){return"
"+text+"
("+nbElems+")
";}return"
"+text+"
("+nbElems+")
";}function showResults(results){if(results.others.length===1&&getCurrentValue("rustdoc-go-to-only-result")==="true"){var elem=document.createElement("a");elem.href=results.others[0].href;elem.style.display="none";document.body.appendChild(elem);elem.click();}var query=getQuery(search_input.value);currentResults=query.id;var ret_others=addTab(results.others,query);var ret_in_args=addTab(results.in_args,query,false);var ret_returned=addTab(results.returned,query,false);var output="

Results for "+escape(query.query)+(query.type?" (type: "+escape(query.type)+")":"")+"

"+"
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"+ret_others[0]+ret_in_args[0]+ret_returned[0]+"
";addClass(main,"hidden");var search=document.getElementById("search");removeClass(search,"hidden");search.innerHTML=output;var tds=search.getElementsByTagName("td");var td_width=0;if(tds.length>0){td_width=tds[0].offsetWidth;}var width=search.offsetWidth-40-td_width;onEachLazy(search.getElementsByClassName("desc"),function(e){e.style.width=width+"px";});initSearchNav();var elems=document.getElementById("titles").childNodes;elems[0].onclick=function(){printTab(0);};elems[1].onclick=function(){printTab(1);};elems[2].onclick=function(){printTab(2);};printTab(currentTab);}function execSearch(query,searchWords,filterCrates){function getSmallest(arrays,positions,notDuplicates){var start=null;for(var it=0;itpositions[it]&&(start===null||start>arrays[it][positions[it]].lev)&&!notDuplicates[arrays[it][positions[it]].fullPath]){start=arrays[it][positions[it]].lev;}}return start;}function mergeArrays(arrays){var ret=[];var positions=[];var notDuplicates={};for(var x=0;xpositions[x]&&arrays[x][positions[x]].lev===smallest&&!notDuplicates[arrays[x][positions[x]].fullPath]){ret.push(arrays[x][positions[x]]);notDuplicates[arrays[x][positions[x]].fullPath]=true;positions[x]+=1;}}}return ret;}var queries=query.raw.split(",");var results={"in_args":[],"returned":[],"others":[],};for(var i=0;i1){return{"in_args":mergeArrays(results.in_args),"returned":mergeArrays(results.returned),"others":mergeArrays(results.others),};}else{return{"in_args":results.in_args[0],"returned":results.returned[0],"others":results.others[0],};}}function getFilterCrates(){var elem=document.getElementById("crate-search");if(elem&&elem.value!=="All crates"&&rawSearchIndex.hasOwnProperty(elem.value)){return elem.value;}return undefined;}function search(e,forced){var params=getQueryStringParams();var query=getQuery(search_input.value.trim());if(e){e.preventDefault();}if(query.query.length===0){return;}if(forced!==true&&query.id===currentResults){if(query.query.length>0){putBackSearch(search_input);}return;}document.title="Results for "+query.query+" - Rust";if(browserSupportsHistoryApi()){if(!history.state&&!params.search){history.pushState(query,"","?search="+encodeURIComponent(query.raw));}else{history.replaceState(query,"","?search="+encodeURIComponent(query.raw));}}var filterCrates=getFilterCrates();showResults(execSearch(query,index,filterCrates),filterCrates);}function buildIndex(rawSearchIndex){searchIndex=[];var searchWords=[];var i;for(var crate in rawSearchIndex){if(!rawSearchIndex.hasOwnProperty(crate)){continue;}searchWords.push(crate);searchIndex.push({crate:crate,ty:1,name:crate,path:"",desc:rawSearchIndex[crate].doc,type:null,});var items=rawSearchIndex[crate].i;var paths=rawSearchIndex[crate].p;var len=paths.length;for(i=0;i"+""+"
"+code.outerHTML+"
";list.appendChild(display);}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors);}function labelForToggleButton(sectionIsCollapsed){if(sectionIsCollapsed){return"+";}return"\u2212";}function onEveryMatchingChild(elem,className,func){if(elem&&className&&func){var length=elem.childNodes.length;var nodes=elem.childNodes;for(var i=0;i"+labelForToggleButton(sectionIsCollapsed)+"
]";return toggle;}var toggle=createSimpleToggle(false);var hideMethodDocs=getCurrentValue("rustdoc-method-docs")==="true";var pageId=getPageId();var func=function(e){var next=e.nextElementSibling;if(!next){return;}if(hasClass(next,"docblock")===true||(hasClass(next,"stability")===true&&hasClass(next.nextElementSibling,"docblock")===true)){var newToggle=toggle.cloneNode(true);insertAfter(newToggle,e.childNodes[e.childNodes.length-1]);if(hideMethodDocs===true&&hasClass(e,"method")===true){collapseDocs(newToggle,"hide",pageId);}}};var funcImpl=function(e){var next=e.nextElementSibling;if(next&&hasClass(next,"docblock")){next=next.nextElementSibling;}if(!next){return;}if(next.getElementsByClassName("method").length>0&&hasClass(e,"impl")){insertAfter(toggle.cloneNode(true),e.childNodes[e.childNodes.length-1]);}};onEachLazy(document.getElementsByClassName("method"),func);onEachLazy(document.getElementsByClassName("associatedconstant"),func);onEachLazy(document.getElementsByClassName("impl"),funcImpl);var impl_call=function(){};if(hideMethodDocs===true){impl_call=function(e,newToggle,pageId){if(e.id.match(/^impl(?:-\d+)?$/)===null){if(hasClass(e,"impl")===true){collapseDocs(newToggle,"hide",pageId);}}};}var newToggle=document.createElement("a");newToggle.href="javascript:void(0)";newToggle.className="collapse-toggle hidden-default collapsed";newToggle.innerHTML="["+labelForToggleButton(true)+"] Show hidden undocumented items";function toggleClicked(){if(hasClass(this,"collapsed")){removeClass(this,"collapsed");onEachLazy(this.parentNode.getElementsByClassName("hidden"),function(x){if(hasClass(x,"content")===false){removeClass(x,"hidden");addClass(x,"x");}},true);this.innerHTML="["+labelForToggleButton(false)+"] Hide undocumented items";}else{addClass(this,"collapsed");onEachLazy(this.parentNode.getElementsByClassName("x"),function(x){if(hasClass(x,"content")===false){addClass(x,"hidden");removeClass(x,"x");}},true);this.innerHTML="["+labelForToggleButton(true)+"] Show hidden undocumented items";}}onEachLazy(document.getElementsByClassName("impl-items"),function(e){onEachLazy(e.getElementsByClassName("associatedconstant"),func);var hiddenElems=e.getElementsByClassName("hidden");var needToggle=false;var hlength=hiddenElems.length;for(var i=0;i0){inner[0].innerHTML="+";}}if(extraClass){addClass(wrapper,extraClass);}wrapper.appendChild(mainToggle);return wrapper;}var showItemDeclarations=getCurrentValue("rustdoc-item-declarations")==="false";function buildToggleWrapper(e){if(hasClass(e,"autohide")){var wrap=e.previousElementSibling;if(wrap&&hasClass(wrap,"toggle-wrapper")){var inner_toggle=wrap.childNodes[0];var extra=e.childNodes[0].tagName==="H3";e.style.display="none";addClass(wrap,"collapsed");onEachLazy(inner_toggle.getElementsByClassName("inner"),function(e){e.innerHTML=labelForToggleButton(true);});onEachLazy(inner_toggle.getElementsByClassName("toggle-label"),function(e){e.style.display="inline-block";if(extra===true){i_e.innerHTML=" Show "+e.childNodes[0].innerHTML;}});}}if(e.parentNode.id==="main"){var otherMessage="";var fontSize;var extraClass;if(hasClass(e,"type-decl")){fontSize="20px";otherMessage=" Show declaration";if(showItemDeclarations===false){extraClass="collapsed";}}else if(hasClass(e,"sub-variant")){otherMessage=" Show fields";}else if(hasClass(e,"non-exhaustive")){otherMessage=" This ";if(hasClass(e,"non-exhaustive-struct")){otherMessage+="struct";}else if(hasClass(e,"non-exhaustive-enum")){otherMessage+="enum";}else if(hasClass(e,"non-exhaustive-variant")){otherMessage+="enum variant";}else if(hasClass(e,"non-exhaustive-type")){otherMessage+="type";}otherMessage+=" is marked as non-exhaustive";}else if(hasClass(e.childNodes[0],"impl-items")){extraClass="marg-left";}e.parentNode.insertBefore(createToggle(otherMessage,fontSize,extraClass,hasClass(e,"type-decl")===false||showItemDeclarations===true),e);if(hasClass(e,"type-decl")===true&&showItemDeclarations===true){collapseDocs(e.previousSibling.childNodes[0],"toggle");}if(hasClass(e,"non-exhaustive")===true){collapseDocs(e.previousSibling.childNodes[0],"toggle");}}}onEachLazy(document.getElementsByClassName("docblock"),buildToggleWrapper);onEachLazy(document.getElementsByClassName("sub-variant"),buildToggleWrapper);function createToggleWrapper(tog){var span=document.createElement("span");span.className="toggle-label";span.style.display="none";span.innerHTML=" Expand attributes";tog.appendChild(span);var wrapper=document.createElement("div");wrapper.className="toggle-wrapper toggle-attributes";wrapper.appendChild(tog);return wrapper;}var itemAttributesFunc=function(){};if(getCurrentValue("rustdoc-item-attributes")!=="false"){itemAttributesFunc=function(x){collapseDocs(x.previousSibling.childNodes[0],"toggle");};}var attributesToggle=createToggleWrapper(createSimpleToggle(false));onEachLazy(main.getElementsByClassName("attributes"),function(i_e){var attr_tog=attributesToggle.cloneNode(true);if(hasClass(i_e,"top-attr")===true){addClass(attr_tog,"top-attr");}i_e.parentNode.insertBefore(attr_tog,i_e);itemAttributesFunc(i_e);});var lineNumbersFunc=function(){};if(getCurrentValue("rustdoc-line-numbers")==="true"){lineNumbersFunc=function(x){var count=x.textContent.split("\n").length;var elems=[];for(var i=0;i
✕"+"
"+content+"";document.getElementsByTagName("body")[0].appendChild(modal);document.getElementById("modal-close").onclick=hideModal;modal.onclick=hideModal;}function hideModal(){var modal=document.getElementById("important");if(modal){modal.parentNode.removeChild(modal);}}onEachLazy(document.getElementsByClassName("important-traits"),function(e){e.onclick=function(){showModal(e.lastElementChild.innerHTML);};});function printTab(nb){if(nb===0||nb===1||nb===2){currentTab=nb;}var nb_copy=nb;onEachLazy(document.getElementById("titles").childNodes,function(elem){if(nb_copy===0){addClass(elem,"selected");}else{removeClass(elem,"selected");}nb_copy-=1;});onEachLazy(document.getElementById("results").childNodes,function(elem){if(nb===0){elem.style.display="";}else{elem.style.display="none";}nb-=1;});}function putBackSearch(search_input){if(search_input.value!==""){addClass(main,"hidden");removeClass(document.getElementById("search"),"hidden");if(browserSupportsHistoryApi()){history.replaceState(search_input.value,"","?search="+encodeURIComponent(search_input.value));}}}if(search_input){search_input.onfocus=function(){putBackSearch(this);};}var params=getQueryStringParams();if(params&¶ms.search){addClass(main,"hidden");var search=document.getElementById("search");removeClass(search,"hidden");search.innerHTML="

Loading search results...

";}var sidebar_menu=document.getElementsByClassName("sidebar-menu")[0];if(sidebar_menu){sidebar_menu.onclick=function(){var sidebar=document.getElementsByClassName("sidebar")[0];if(hasClass(sidebar,"mobile")===true){hideSidebar();}else{showSidebar();}};}window.onresize=function(){hideSidebar();};autoCollapse(getPageId(),getCurrentValue("rustdoc-collapse")==="true");if(window.location.hash&&window.location.hash.length>0){expandSection(window.location.hash.replace(/^#/,""));}if(main){onEachLazy(main.getElementsByClassName("loading-content"),function(e){e.remove();});onEachLazy(main.childNodes,function(e){if(e.tagName==="H2"||e.tagName==="H3"){var nextTagName=e.nextElementSibling.tagName;if(nextTagName=="H2"||nextTagName=="H3"){e.nextElementSibling.style.display="flex";}else{e.nextElementSibling.style.display="block";}}});}function addSearchOptions(crates){var elem=document.getElementById('crate-search');if(!elem){return;}var crates_text=[];if(Object.keys(crates).length>1){for(var crate in crates){if(crates.hasOwnProperty(crate)){crates_text.push(crate);}}}crates_text.sort(function(a,b){var lower_a=a.toLowerCase();var lower_b=b.toLowerCase();if(lower_alower_b){return 1;}return 0;});for(var i=0;i