+/livesplit-wrapper

git clone https://git.julia.blue/+/livesplit-wrapper

P1n3appl3deploy: 9b9f353f3b0e319547cabc5dcadc542d5ab54386b0170e4

gh-pages
13.5 KiB39 linesraw
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 autosplitter’s interface for interacting with the LiveSpilit timer."><meta name="keywords" content="rust, rustlang, rust-lang, HostFunctions"><title>HostFunctions 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">&#9776;</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="#">HostFunctions</a></h2><div class="sidebar-elems"><section><div class="block"><h3 class="sidebar-title"><a href="#provided-methods">Provided Methods</a></h3><ul><li><a href="#method.attach">attach</a></li><li><a href="#method.pause">pause</a></li><li><a href="#method.reset">reset</a></li><li><a href="#method.set_game_time">set_game_time</a></li><li><a href="#method.set_tick_rate">set_tick_rate</a></li><li><a href="#method.set_variable">set_variable</a></li><li><a href="#method.split">split</a></li><li><a href="#method.start">start</a></li><li><a href="#method.state">state</a></li><li><a href="#method.unpause">unpause</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="#">HostFunctions</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#112-188">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust trait"><code>pub trait HostFunctions {
4    fn <a href="#method.attach" class="fnname">attach</a>(&amp;self, name: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.Process.html" title="struct livesplit_wrapper::Process">Process</a>&gt; { ... }
5<span class="item-spacer"></span>    fn <a href="#method.start" class="fnname">start</a>(&amp;self) { ... }
6<span class="item-spacer"></span>    fn <a href="#method.pause" class="fnname">pause</a>(&amp;self) { ... }
7<span class="item-spacer"></span>    fn <a href="#method.unpause" class="fnname">unpause</a>(&amp;self) { ... }
8<span class="item-spacer"></span>    fn <a href="#method.split" class="fnname">split</a>(&amp;self) { ... }
9<span class="item-spacer"></span>    fn <a href="#method.reset" class="fnname">reset</a>(&amp;self) { ... }
10<span class="item-spacer"></span>    fn <a href="#method.set_game_time" class="fnname">set_game_time</a>(&amp;self, time: <a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>) { ... }
11<span class="item-spacer"></span>    fn <a href="#method.set_tick_rate" class="fnname">set_tick_rate</a>(&amp;self, rate: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>) { ... }
12<span class="item-spacer"></span>    fn <a href="#method.state" class="fnname">state</a>(&amp;self) -&gt; <a class="enum" href="enum.TimerState.html" title="enum livesplit_wrapper::TimerState">TimerState</a> { ... }
13<span class="item-spacer"></span>    fn <a href="#method.set_variable" class="fnname">set_variable</a>(&amp;self, key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, value: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) { ... }
14}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The autosplitter’s interface for interacting with the LiveSpilit timer.</p>
15</div></details><h2 id="provided-methods" class="small-section-header">Provided Methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="method.attach" class="method has-srclink"><a class="srclink rightside" href="../src/livesplit_wrapper/lib.rs.html#114-121">source</a><h4 class="code-header">fn <a href="#method.attach" class="fnname">attach</a>(&amp;self, name: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="struct.Process.html" title="struct livesplit_wrapper::Process">Process</a>&gt;</h4></div></summary><div class="docblock"><p>Attach to a process running on the same machine as the autosplitter.</p>
16</div></details><details class="rustdoc-toggle" open><summary><div id="method.start" class="method has-srclink"><a class="srclink rightside" href="../src/livesplit_wrapper/lib.rs.html#126-128">source</a><h4 class="code-header">fn <a href="#method.start" class="fnname">start</a>(&amp;self)</h4></div></summary><div class="docblock"><p>Start the timer for a run. Note that this will silently do nothing on
17subsequent calls. To start a new run, call <code>reset()</code> and <em>then</em>
18<code>start()</code>.</p>
19</div></details><details class="rustdoc-toggle" open><summary><div id="method.pause" class="method has-srclink"><a class="srclink rightside" href="../src/livesplit_wrapper/lib.rs.html#135-137">source</a><h4 class="code-header">fn <a href="#method.pause" class="fnname">pause</a>(&amp;self)</h4></div></summary><div class="docblock"><p>Pause the game time counter. This is often used when entering a loading
20screen or end level screen for games that use in-game time rather
21than real time. It may be a good idea to call <code>set_game_time()</code>
22immediately after pausing so that LiveSplit’s game time counter
23shows the exact current time.</p>
24</div></details><details class="rustdoc-toggle" open><summary><div id="method.unpause" class="method has-srclink"><a class="srclink rightside" href="../src/livesplit_wrapper/lib.rs.html#140-142">source</a><h4 class="code-header">fn <a href="#method.unpause" class="fnname">unpause</a>(&amp;self)</h4></div></summary><div class="docblock"><p>Resume the game time counter.</p>
25</div></details><details class="rustdoc-toggle" open><summary><div id="method.split" class="method has-srclink"><a class="srclink rightside" href="../src/livesplit_wrapper/lib.rs.html#145-147">source</a><h4 class="code-header">fn <a href="#method.split" class="fnname">split</a>(&amp;self)</h4></div></summary><div class="docblock"><p>Mark the current split as finished and move to the next one.</p>
26</div></details><details class="rustdoc-toggle" open><summary><div id="method.reset" class="method has-srclink"><a class="srclink rightside" href="../src/livesplit_wrapper/lib.rs.html#153-155">source</a><h4 class="code-header">fn <a href="#method.reset" class="fnname">reset</a>(&amp;self)</h4></div></summary><div class="docblock"><p>Reset the run. Don’t do this automatically when a run has finished, and
27in general be conservative about resetting runs from the
28autosplitter. Common practice is to do so only if there’s an
29unambiguous signal that the player is done with this run.</p>
30</div></details><details class="rustdoc-toggle" open><summary><div id="method.set_game_time" class="method has-srclink"><a class="srclink rightside" href="../src/livesplit_wrapper/lib.rs.html#160-162">source</a><h4 class="code-header">fn <a href="#method.set_game_time" class="fnname">set_game_time</a>(&amp;self, time: <a class="struct" href="https://doc.rust-lang.org/nightly/core/time/struct.Duration.html" title="struct core::time::Duration">Duration</a>)</h4></div></summary><div class="docblock"><p>Set the game time. Note that if the timer is not paused, the time shown
31will keep incrementing immediately after it is set to the given
32value.</p>
33</div></details><details class="rustdoc-toggle" open><summary><div id="method.set_tick_rate" class="method has-srclink"><a class="srclink rightside" href="../src/livesplit_wrapper/lib.rs.html#166-168">source</a><h4 class="code-header">fn <a href="#method.set_tick_rate" class="fnname">set_tick_rate</a>(&amp;self, rate: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.f64.html">f64</a>)</h4></div></summary><div class="docblock"><p>Set the rate at which the <a href="trait.Splitter.html#tymethod.update"><code>update</code></a> function will be
34called (in Hz).</p>
35</div></details><details class="rustdoc-toggle" open><summary><div id="method.state" class="method has-srclink"><a class="srclink rightside" href="../src/livesplit_wrapper/lib.rs.html#172-174">source</a><h4 class="code-header">fn <a href="#method.state" class="fnname">state</a>(&amp;self) -&gt; <a class="enum" href="enum.TimerState.html" title="enum livesplit_wrapper::TimerState">TimerState</a></h4></div></summary><div class="docblock"><p>Get the current state of the timer. This is how the autosplitter can
36detect if the player manually paused or reset a run.</p>
37</div></details><details class="rustdoc-toggle" open><summary><div id="method.set_variable" class="method has-srclink"><a class="srclink rightside" href="../src/livesplit_wrapper/lib.rs.html#178-187">source</a><h4 class="code-header">fn <a href="#method.set_variable" class="fnname">set_variable</a>(&amp;self, key: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>, value: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>)</h4></div></summary><div class="docblock"><p>Set a variable which can be displayed by LiveSplit. This is commonly
38used for features like death counters.</p>
39</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"><section id="impl-HostFunctions-for-T" class="impl has-srclink"><a class="srclink rightside" href="../src/livesplit_wrapper/lib.rs.html#190">source</a><a href="#impl-HostFunctions-for-T" class="anchor"></a><h3 class="code-header in-band">impl&lt;T:&nbsp;<a class="trait" href="trait.Splitter.html" title="trait livesplit_wrapper::Splitter">Splitter</a>&gt; <a class="trait" href="trait.HostFunctions.html" title="trait livesplit_wrapper::HostFunctions">HostFunctions</a> for T</h3></section></div><script src="../implementors/livesplit_wrapper/trait.HostFunctions.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>