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
ASegment represents a single split point in a speedrun — the moment the runner presses their split key. Each segment stores:
- A name (e.g.
"Forgotten Crossroads") - An optional icon
- Split times for every comparison (the cumulative time at which the runner hit this split)
- A best segment time (the fastest individual segment time across all attempts)
- A segment history — a record of individual segment times from every past attempt
Run is an ordered list of Segment values. The last segment’s split time is the final time for the whole run.
Construction
Segment::new<S: Into<String>>(name: S) -> Segment
Creates a new segment with the given name. All time fields start empty.
Name
name(&self) -> &str
Returns the name of the segment.
set_name<S: PopulateString>(&mut self, name: S)
Sets the name of the segment.
Split Times
Split times in livesplit-core use theTime struct, which wraps both a real_time: Option<TimeSpan> and a game_time: Option<TimeSpan>. Either or both may be None if not recorded.
personal_best_split_time(&self) -> Time
Returns the cumulative split time for the "Personal Best" comparison. This is the time at which the runner reached this segment in their personal best run. Returns an empty Time if no PB is set.
set_personal_best_split_time(&mut self, time: Time)
Sets the split time for the Personal Best comparison.
best_segment_time(&self) -> Time
Returns the best (fastest) individual segment time recorded across all attempts — not cumulative, just the time spent on this one segment. Returns an empty Time if none is recorded.
best_segment_time_mut(&mut self) -> &mut Time
Provides mutable access to the best segment time.
set_best_segment_time(&mut self, time: Time)
Sets the best segment time.
split_time(&self) -> Time
Returns the cumulative split time for the current attempt (set live by the timer). This is cleared when an attempt ends or is reset.
set_split_time(&mut self, time: Time)
Sets the split time for the current attempt.
clear_split_time(&mut self)
Clears the split time for the current attempt (resets it to empty).
comparison(&self, comparison: &str) -> Time
Returns the split time for any named comparison. If this segment has no time stored for that comparison, an empty Time is returned (it is not inserted into the segment).
comparison_mut(&mut self, comparison: &str) -> &mut Time
Returns a mutable reference to the specified comparison’s time. If none exists, an empty time is inserted first.
comparison_timing_method(&self, comparison: &str, method: TimingMethod) -> Option<TimeSpan>
Returns the TimeSpan for a specific comparison and timing method. Returns None if either the comparison has no entry or the timing method’s value is empty.
Icon
icon(&self) -> &Image
Returns the segment’s icon. If no icon has been set, the image data is empty.
set_icon(&mut self, image: Image)
Sets the segment’s icon.
Segment History
The segment history records the individual time spent on this segment during each past attempt (not cumulative — just the delta for this one segment).segment_history(&self) -> &SegmentHistory
Returns an immutable reference to the segment’s history. SegmentHistory is an ordered map of attempt index → Time.