fork/rules_rust
git clone https://git.julia.blue/fork/rules_rust
482a21cf
gh-pages
1<!DOCTYPE HTML > 2< html lang ="en "class ="light sidebar-visible "dir ="ltr "> 3< head > 4<!-- Book generated using mdBook --> 5< meta charset ="UTF-8 "> 6< title > Rules - rules_rust</ title > 7 8 9<!-- Custom HTML head --> 10 11< meta name ="description "content =""> 12< meta name ="viewport "content ="width=device-width, initial-scale=1 "> 13< meta name ="theme-color "content ="#ffffff "> 14 15< link rel ="icon "href ="favicon.svg "> 16< link rel ="shortcut icon "href ="favicon.png "> 17< link rel ="stylesheet "href ="css/variables.css "> 18< link rel ="stylesheet "href ="css/general.css "> 19< link rel ="stylesheet "href ="css/chrome.css "> 20< link rel ="stylesheet "href ="css/print.css "media ="> 21 22<!-- Fonts --> 23< link rel ="stylesheet "href ="FontAwesome/css/font-awesome.css "> 24< link rel ="stylesheet "href ="fonts/fonts.css "> 25 26<!-- Highlight.js Stylesheets --> 27< link rel ="stylesheet "href ="highlight.css "> 28< link rel ="stylesheet "href ="tomorrow-night.css "> 29< link rel ="stylesheet "href ="ayu-highlight.css "> 30 31<!-- Custom theme stylesheets --> 32 33 34<!-- Provide site root to javascript --> 35< script > 36var path_to_root = "" ; 37var default_theme = window . matchMedia ( "(prefers-color-scheme: dark)" ). matches ?"navy" :"light" ; 38</ script > 39<!-- Start loading toc.js asap --> 40< script src ="toc.js "></ script > 41</ head > 42< body > 43< div id ="body-container "> 44<!-- Work around some values being stored in localStorage wrapped in quotes --> 45< script > 46try { 47var theme = localStorage . getItem ( 'mdbook-theme' ); 48var sidebar = localStorage . getItem ( 'mdbook-sidebar' ); 49 50if ( theme . startsWith ( '"' ) && theme . endsWith ( '"' )) { 51localStorage . setItem ( 'mdbook-theme' , theme . slice ( 1 , theme . length - 1 )); 52} 53 54if ( sidebar . startsWith ( '"' ) && sidebar . endsWith ( '"' )) { 55localStorage . setItem ( 'mdbook-sidebar' , sidebar . slice ( 1 , sidebar . length - 1 )); 56} 57} catch ( e ) { } 58</ script > 59 60<!-- Set the theme before any content is loaded, prevents flash --> 61< script > 62var theme ; 63try { theme = localStorage . getItem ( 'mdbook-theme' ); } catch ( e ) { } 64if ( theme === null || theme === undefined ) { theme = default_theme ; } 65const html = document . documentElement ; 66html . classList . remove ( 'light' ) 67html . classList . add ( theme ); 68html . classList . add ( "js" ); 69</ script > 70 71< input type ="checkbox "id ="sidebar-toggle-anchor "class ="hidden "> 72 73<!-- Hide / unhide sidebar before it is displayed --> 74< script > 75var sidebar = null ; 76var sidebar_toggle = document . getElementById ( "sidebar-toggle-anchor" ); 77if ( document . body . clientWidth >= 1080 ) { 78try { sidebar = localStorage . getItem ( 'mdbook-sidebar' ); } catch ( e ) { } 79sidebar = sidebar || 'visible' ; 80} else { 81sidebar = 'hidden' ; 82} 83sidebar_toggle . checked = sidebar === 'visible' ; 84html . classList . remove ( 'sidebar-visible' ); 85html . classList . add ( "sidebar-" + sidebar ); 86</ script > 87 88< nav id ="sidebar "class ="sidebar "aria-label ="Table of contents "> 89<!-- populated by js --> 90< mdbook-sidebar-scrollbox class ="sidebar-scrollbox "></ mdbook-sidebar-scrollbox > 91< noscript > 92< iframe class ="sidebar-iframe-outer "src ="toc.html "></ iframe > 93</ noscript > 94< div id ="sidebar-resize-handle "class ="sidebar-resize-handle "> 95< div class ="sidebar-resize-indicator "></ div > 96</ div > 97</ nav > 98 99< div id ="page-wrapper "class ="page-wrapper "> 100 101< div class ="page "> 102< div id ="menu-bar-hover-placeholder "></ div > 103< div id ="menu-bar "class ="menu-bar sticky "> 104< div class ="left-buttons "> 105< label id ="sidebar-toggle "class ="icon-button "for ="sidebar-toggle-anchor "title ="Toggle Table of Contents "aria-label ="Toggle Table of Contents "aria-controls ="sidebar "> 106< i class ="fa fa-bars "></ i > 107</ label > 108< button id ="theme-toggle "class ="icon-button "type ="button "title ="Change theme "aria-label ="Change theme "aria-haspopup ="true "aria-expanded ="false "aria-controls ="theme-list "> 109< i class ="fa fa-paint-brush "></ i > 110</ button > 111< ul id ="theme-list "class ="theme-popup "aria-label ="Themes "role ="menu "> 112< li role ="none ">< button role ="menuitem "class ="theme "id ="light "> Light</ button ></ li > 113< li role ="none ">< button role ="menuitem "class ="theme "id ="rust "> Rust</ button ></ li > 114< li role ="none ">< button role ="menuitem "class ="theme "id ="coal "> Coal</ button ></ li > 115< li role ="none ">< button role ="menuitem "class ="theme "id ="navy "> Navy</ button ></ li > 116< li role ="none ">< button role ="menuitem "class ="theme "id ="ayu "> Ayu</ button ></ li > 117</ ul > 118< button id ="search-toggle "class ="icon-button "type ="button "title ="Search. (Shortkey: s) "aria-label ="Toggle Searchbar "aria-expanded ="false "aria-keyshortcuts ="S "aria-controls ="searchbar "> 119< i class ="fa fa-search "></ i > 120</ button > 121</ div > 122 123< h1 class ="menu-title "> rules_rust</ h1 > 124 125< div class ="right-buttons "> 126< a href ="print.html "title ="Print this book "aria-label ="Print this book "> 127< i id ="print-button "class ="fa fa-print "></ i > 128</ a > 129< a href ="https://github.com/bazelbuild/rules_rust "title ="Git repository "aria-label ="Git repository "> 130< i id ="git-repository-button "class ="fa fa-github "></ i > 131</ a > 132 133</ div > 134</ div > 135 136< div id ="search-wrapper "class ="hidden "> 137< form id ="searchbar-outer "class ="searchbar-outer "> 138< input type ="search "id ="searchbar "name ="searchbar "placeholder ="Search this book ... "aria-controls ="searchresults-outer "aria-describedby ="searchresults-header "> 139</ form > 140< div id ="searchresults-outer "class ="searchresults-outer hidden "> 141< div id ="searchresults-header "class ="searchresults-header "></ div > 142< ul id ="searchresults "> 143</ ul > 144</ div > 145</ div > 146 147<!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM --> 148< script > 149document . getElementById ( 'sidebar-toggle' ). setAttribute ( 'aria-expanded' , sidebar === 'visible' ); 150document . getElementById ( 'sidebar' ). setAttribute ( 'aria-hidden' , sidebar !== 'visible' ); 151Array . from ( document . querySelectorAll ( '#sidebar a' )). forEach ( function ( link ) { 152link . setAttribute ( 'tabIndex' , sidebar === 'visible' ?0 :- 1 ); 153}); 154</ script > 155 156< div id ="content "class ="content "> 157< main > 158< h1 id ="rules ">< a class ="header "href ="#rules "> Rules</ a ></ h1 > 159< ul > 160< li >< a href ="defs.html "> defs</ a > : standard rust rules for building and testing libraries and binaries.</ li > 161< li >< a href ="rust_doc.html "> rustdoc</ a > : rules for generating and testing rust documentation.</ li > 162< li >< a href ="rust_clippy.html "> clippy</ a > : rules for running< a href ="https://github.com/rust-lang/rust-clippy#readme "> clippy</ a > .</ li > 163< li >< a href ="rust_fmt.html "> rustfmt</ a > : rules for running< a href ="https://github.com/rust-lang/rustfmt#readme "> rustfmt</ a > .</ li > 164< li >< a href ="cargo.html "> cargo</ a > : Rules dedicated to Cargo compatibility. ie:< a href ="https://doc.rust-lang.org/cargo/reference/build-scripts.html ">< code > build.rs</ code > scripts</ a > .</ li > 165< li >< a href ="external_crates.html "> crate_universe</ a > : Rules for generating Bazel targets for external crate dependencies.</ li > 166</ ul > 167< h2 id ="experimental-rules ">< a class ="header "href ="#experimental-rules "> Experimental rules</ a ></ h2 > 168< ul > 169< li >< a href ="rust_analyzer.html "> rust_analyzer</ a > : rules for generating< code > rust-project.json</ code > files for< a href ="https://rust-analyzer.github.io/ "> rust-analyzer</ a ></ li > 170</ ul > 171< h2 id ="3rd-party-rules ">< a class ="header "href ="#3rd-party-rules "> 3rd party rules</ a ></ h2 > 172< ul > 173< li >< a href ="rust_bindgen.html "> rust_bindgen</ a > : rules for generating C++ bindings.</ li > 174< li >< a href ="rust_prost.html "> rust_prost</ a > : rules for generating< a href ="https://developers.google.com/protocol-buffers "> protobuf</ a > and< a href ="https://grpc.io "> gRPC</ a > stubs using< a href ="https://github.com/tokio-rs/prost "> prost</ a > .</ li > 175< li >< a href ="rust_protobuf.html "> rust_protobuf</ a > : rules for generating< a href ="https://developers.google.com/protocol-buffers "> protobuf</ a > and< a href ="https://grpc.io "> gRPC</ a > stubs with< a href ="https://github.com/stepancheg/rust-protobuf/ "> rust-protobuf</ a ></ li > 176< li >< a href ="rust_wasm_bindgen.html "> rust_wasm_bindgen</ a > : rules for generating< a href ="https://www.rust-lang.org/what/wasm "> WebAssembly</ a > bindings.</ li > 177</ ul > 178< h2 id ="full-api ">< a class ="header "href ="#full-api "> Full API</ a ></ h2 > 179< p > You can also browse the< a href ="flatten.html "> full API in one page</ a > .</ p > 180 181</ main > 182 183< nav class ="nav-wrapper "aria-label ="Page navigation "> 184<!-- Mobile navigation buttons --> 185< a rel ="prev "href ="index.html "class ="mobile-nav-chapters previous "title ="Previous chapter "aria-label ="Previous chapter "aria-keyshortcuts ="Left "> 186< i class ="fa fa-angle-left "></ i > 187</ a > 188 189< a rel ="next prefetch "href ="rust.html "class ="mobile-nav-chapters next "title ="Next chapter "aria-label ="Next chapter "aria-keyshortcuts ="Right "> 190< i class ="fa fa-angle-right "></ i > 191</ a > 192 193< div style ="clear: both "></ div > 194</ nav > 195</ div > 196</ div > 197 198< nav class ="nav-wide-wrapper "aria-label ="Page navigation "> 199< a rel ="prev "href ="index.html "class ="nav-chapters previous "title ="Previous chapter "aria-label ="Previous chapter "aria-keyshortcuts ="Left "> 200< i class ="fa fa-angle-left "></ i > 201</ a > 202 203< a rel ="next prefetch "href ="rust.html "class ="nav-chapters next "title ="Next chapter "aria-label ="Next chapter "aria-keyshortcuts ="Right "> 204< i class ="fa fa-angle-right "></ i > 205</ a > 206</ nav > 207 208</ div > 209 210 211 212 213< script > 214window . playground_copyable = true ; 215</ script > 216 217 218< script src ="elasticlunr.min.js "></ script > 219< script src ="mark.min.js "></ script > 220< script src ="searcher.js "></ script > 221 222< script src ="clipboard.min.js "></ script > 223< script src ="highlight.js "></ script > 224< script src ="book.js "></ script > 225 226<!-- Custom JS scripts --> 227 228 229</ div > 230</ body > 231</ html >