Documentation Index
Fetch the complete documentation index at: https://mintlify.com/LiveSplit/livesplit-core/llms.txt
Use this file to discover all available pages before exploring further.
Overview
RunMetadata stores optional supplementary information about a run. It is embedded in every Run object and is saved to / loaded from the splits file automatically. All fields are optional and may be empty.
Metadata covers:
- The speedrun.com run ID linking this run to a record on speedrun.com
- The platform and region of the game
- Whether an emulator is used
- speedrun.com category variables (structured key-value pairs tied to a category, e.g. subcategory choices like “Yes Amiibos” vs “No Amiibos”)
- Custom variables — arbitrary user-defined or auto-splitter-defined key-value pairs
speedrun.com Run ID
run_id(&self) -> &str
Returns the speedrun.com run ID associated with this run. This ID links the run to a specific record on speedrun.com. Returns an empty string if no association exists.
set_run_id<S: PopulateString>(&mut self, id: S)
Sets the speedrun.com run ID. You should update this when the Personal Best changes so it stays in sync with the correct speedrun.com record.
Platform
platform_name(&self) -> &str
Returns the name of the platform the game is run on (e.g. "Nintendo Switch", "PC"). Returns an empty string if not specified.
set_platform_name<S: PopulateString>(&mut self, name: S)
Sets the platform name.
Region
region_name(&self) -> &str
Returns the region of the game (e.g. "JPN", "USA"). Returns an empty string if not specified.
set_region_name<S: PopulateString>(&mut self, name: S)
Sets the region name.
Emulator Usage
uses_emulator(&self) -> bool
Returns true if this run is performed on an emulator. Note that false may mean either “not on emulator” or “unknown” — the flag cannot distinguish these two cases.
set_emulator_usage(&mut self, uses_emulator: bool)
Sets the emulator flag. Keep in mind that false may also be interpreted as “information not known”.
speedrun.com Variables
speedrun.com variables are category-level key-value pairs that correspond to specific options defined on speedrun.com — for example, whether Amiibos are used, or which difficulty was selected. They are stored under their speedrun.com variable name.speedrun_com_variables(&self) -> Iter<'_, String>
Returns an iterator over all speedrun.com variables as (&str, &str) pairs of (name, value).
set_speedrun_com_variable<N, V>(&mut self, name: N, value: V)
Sets a speedrun.com variable. If it does not yet exist, it is inserted. If it already exists, its value is updated.
remove_speedrun_com_variable(&mut self, name: &str)
Removes the speedrun.com variable with the given name. Does nothing if the variable does not exist.
Custom Variables
Custom variables are user-defined or auto-splitter-defined key-value string pairs. Unlike speedrun.com variables, they are not tied to any external schema. There are two kinds:- Permanent variables: defined by the runner in the run editor, stored in the splits file, and shown in the UI.
- Temporary variables: set programmatically (e.g. by an auto splitter) at runtime. They are not stored in the splits file and are not shown in the editor.
CustomVariable fields
custom_variables(&self) -> Iter<'_, CustomVariable>
Returns an iterator over all custom variables (both permanent and temporary) as (&str, &CustomVariable) pairs of (name, variable).
custom_variable(&self, name: &str) -> Option<&CustomVariable>
Returns the custom variable with the given name if it exists.
custom_variable_value(&self, name: &str) -> Option<&str>
Returns just the value string of the named custom variable, or None if it does not exist.
custom_variable_mut<S: PopulateString>(&mut self, name: S) -> &mut CustomVariable
Returns a mutable reference to the named custom variable. If it does not exist, it is created as a temporary variable. To make it permanent, call .permanent() on the returned reference.