+/livesplit-wrapper
git clone https://git.julia.blue/+/livesplit-wrapper
b0170e4
gh-pages
1<!DOCTYPE html >< html lang ="en ">< head >< meta charset ="utf-8 ">< meta name ="viewport "content ="width=device-width, initial-scale=1.0 ">< meta name ="generator "content ="rustdoc ">< meta name ="description "content ="The main autosplitter trait. ">< meta name ="keywords "content ="rust, rustlang, rust-lang, Splitter ">< title > Splitter in livesplit_wrapper - Rust</ title >< link rel ="preload "as ="font "type ="font/woff2 "crossorigin href ="../SourceSerif4-Regular.ttf.woff2 ">< link rel ="preload "as ="font "type ="font/woff2 "crossorigin href ="../FiraSans-Regular.woff2 ">< link rel ="preload "as ="font "type ="font/woff2 "crossorigin href ="../FiraSans-Medium.woff2 ">< link rel ="preload "as ="font "type ="font/woff2 "crossorigin href ="../SourceCodePro-Regular.ttf.woff2 ">< link rel ="preload "as ="font "type ="font/woff2 "crossorigin href ="../SourceSerif4-Bold.ttf.woff2 ">< link rel ="preload "as ="font "type ="font/woff2 "crossorigin href ="../SourceCodePro-Semibold.ttf.woff2 ">< link rel ="stylesheet "href ="../normalize.css ">< link rel ="stylesheet "href ="../rustdoc.css "id ="mainThemeStyle ">< link rel ="stylesheet "href ="../ayu.css "disabled >< link rel ="stylesheet "href ="../dark.css "disabled >< link rel ="stylesheet "href ="../light.css "id ="themeStyle ">< script id ="default-settings "></ script >< script src ="../storage.js "></ script >< script defer src ="sidebar-items.js "></ script >< script defer src ="../main.js "></ script >< noscript >< link rel ="stylesheet "href ="../noscript.css "></ noscript >< link rel ="alternate icon "type ="image/png "href ="../favicon-16x16.png ">< link rel ="alternate icon "type ="image/png "href ="../favicon-32x32.png ">< link rel ="icon "type ="image/svg+xml "href ="../favicon.svg "></ head >< body class ="rustdoc trait "> <!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--> < nav class ="mobile-topbar ">< button class ="sidebar-menu-toggle "> ☰</ button >< a class ="sidebar-logo "href ="../livesplit_wrapper/index.html ">< div class ="logo-container ">< img src ="https://github.com/LiveSplit.png "alt ="logo "></ div ></ a >< h2 class ="location "></ h2 ></ nav >< nav class ="sidebar ">< a class ="sidebar-logo "href ="../livesplit_wrapper/index.html ">< div class ="logo-container "> 2< img src ="https://github.com/LiveSplit.png "alt ="logo "></ div ></ a >< h2 class ="location ">< a href ="# "> Splitter</ a ></ h2 >< div class ="sidebar-elems ">< section >< div class ="block ">< h3 class ="sidebar-title ">< a href ="#required-methods "> Required Methods</ a ></ h3 >< ul >< li >< a href ="#tymethod.new "> new</ a ></ li >< li >< a href ="#tymethod.update "> update</ a ></ li ></ ul ></ div >< div class ="block ">< h3 class ="sidebar-title ">< a href ="#implementors "> Implementors</ a ></ h3 ></ div ></ section >< h2 class ="location ">< a href ="index.html "> In livesplit_wrapper</ a ></ h2 ></ div ></ nav >< main >< div class ="width-limiter ">< div class ="sub-container ">< a class ="sub-logo-container "href ="../livesplit_wrapper/index.html "> 3< img src ="https://github.com/LiveSplit.png "alt ="logo "></ a >< nav class ="sub ">< form class ="search-form ">< div class ="search-container ">< span ></ span >< input class ="search-input "name ="search "autocomplete ="off "spellcheck ="false "placeholder ="Click or press ‘S’ to search, ‘?’ for more options… "type ="search ">< div id ="help-button "title ="help "tabindex ="-1 ">< button type ="button "> ?</ button ></ div >< div id ="settings-menu "tabindex ="-1 ">< a href ="../settings.html "title ="settings ">< img width ="22 "height ="22 "alt ="Change settings "src ="../wheel.svg "></ a ></ div ></ div ></ form ></ nav ></ div >< section id ="main-content "class ="content ">< div class ="main-heading ">< h1 class ="fqn ">< span class ="in-band "> Trait< a href ="index.html "> livesplit_wrapper</ a > ::< wbr >< a class ="trait "href ="# "> Splitter</ a >< button id ="copy-path "onclick ="copy_path(this) "title ="Copy item path to clipboard ">< img src ="../clipboard.svg "width ="19 "height ="18 "alt ="Copy item path "></ button ></ span ></ h1 >< span class ="out-of-band ">< a class ="srclink "href ="../src/livesplit_wrapper/lib.rs.html#99-109 "> source</ a > ·< a id ="toggle-all-docs "href ="javascript:void(0) "title ="collapse all docs "> [< span class ="inner "> −</ span > ]</ a ></ span ></ div >< div class ="item-decl ">< pre class ="rust trait ">< code > pub trait Splitter { 4 fn< a href ="#tymethod.new "class ="fnname "> new</ a > () -> Self; 5< span class ="item-spacer "></ span > fn< a href ="#tymethod.update "class ="fnname "> update</ a > (&mut self); 6}</ code ></ pre ></ div >< details class ="rustdoc-toggle top-doc "open >< summary class ="hideme ">< span > Expand description</ span ></ summary >< div class ="docblock ">< p > The main autosplitter trait.</ p > 7< p > This trait is the entry point for the autosplitter’s functionality. The 8< code > new</ code > and< code > update</ code > functions are hooks that will be called by LiveSplit. To 9interact with LiveSplit’s timer, use the functions defined in 10< a href ="trait.HostFunctions.html "title ="HostFunctions ">< code > HostFunctions</ code ></ a > .</ p > 11< p >< a href ="trait.HostFunctions.html "title ="HostFunctions ">< code > HostFunctions</ code ></ a > is automatically implemented on< code > Splitter</ code > s, so in your 12< code > update</ code > function you can call methods like 13< a href ="trait.HostFunctions.html#method.split ">< code > self.split()</ code ></ a > and 14< a href ="trait.HostFunctions.html#method.set_game_time ">< code > self.set_game_time()</ code ></ a > .</ p > 15< h3 id ="remember ">< a href ="#remember "> REMEMBER!</ a ></ h3 > 16< p > Make sure you use the< a href ="macro.register_autosplitter.html "title ="register_autosplitter! ">< code > register_autosplitter!</ code ></ a > macro on your splitter! 17Without it, your wasm library won’t expose the proper functions and it’ll 18fail to load.</ p > 19</ div ></ details >< h2 id ="required-methods "class ="small-section-header "> Required Methods< a href ="#required-methods "class ="anchor "></ a ></ h2 >< div class ="methods ">< details class ="rustdoc-toggle "open >< summary >< div id ="tymethod.new "class ="method has-srclink ">< a class ="srclink rightside "href ="../src/livesplit_wrapper/lib.rs.html#104 "> source</ a >< h4 class ="code-header "> fn< a href ="#tymethod.new "class ="fnname "> new</ a > () -> Self</ h4 ></ div ></ summary >< div class ="docblock ">< p > Called when the LiveSplit runtime instantiates your splitter. It’s a 20good time to attach to a game process, set initial variables, or 21change your tick rate. Note that this< em > won’t</ em > be called every time 22the run is reset.</ p > 23</ div ></ details >< details class ="rustdoc-toggle "open >< summary >< div id ="tymethod.update "class ="method has-srclink ">< a class ="srclink rightside "href ="../src/livesplit_wrapper/lib.rs.html#108 "> source</ a >< h4 class ="code-header "> fn< a href ="#tymethod.update "class ="fnname "> update</ a > (&mut self)</ h4 ></ div ></ summary >< div class ="docblock ">< p > Called periodically by the LiveSplit runtime. To change the rate that 24it’s called, use< a href ="trait.HostFunctions.html#method.set_tick_rate ">< code > set_tick_rate</ code ></ a ></ p > 25</ div ></ details ></ div >< h2 id ="implementors "class ="small-section-header "> Implementors< a href ="#implementors "class ="anchor "></ a ></ h2 >< div class ="item-list "id ="implementors-list "></ div >< script src ="../implementors/livesplit_wrapper/trait.Splitter.js "async ></ script ></ section ></ div ></ main >< div id ="rustdoc-vars "data-root-path ="../ "data-current-crate ="livesplit_wrapper "data-themes ="ayu,dark,light "data-resource-suffix =""data-rustdoc-version ="1.66.0-nightly (4a1467723 2022-09-23) "></ div ></ body ></ html >