[][src]Struct livesplit_core::SegmentHistory

pub struct SegmentHistory(_);

Stores the segment times achieved for a certain segment. Each segment is tagged with an index. Only segment times with an index larger than 0 are considered times actually achieved by the runner, while the others are artifacts of route changes and similar algorithmic changes.

Methods

impl SegmentHistory[src]

pub fn try_get_min_index(&self) -> Option<i32>[src]

Returns the minimum index of all the segment times. Returns None if there's no segment times in this history.

pub fn min_index(&self) -> i32[src]

Returns the minimum index of all the segment times. If there's no segment times or the minimum is less than 1, 1 is returned instead.

pub fn try_get_max_index(&self) -> Option<i32>[src]

Returns the maximum index of all the segment times. Returns None if there's no segment times in this history.

pub fn insert(&mut self, index: i32, time: Time)[src]

Inserts a new segment time into the Segment History, with the index provided. If there's already a segment time with that index, the time is not inserted.

pub fn get(&self, index: i32) -> Option<Time>[src]

Accesses the segment time with the given index. If there's no segment time with that index, None is returned instead.

pub fn get_mut(&mut self, index: i32) -> Option<&mut Time>[src]

Grants mutable access to the segment time with the given index. If there's no segment time with that index, None is returned instead.

pub fn remove(&mut self, index: i32)[src]

Removes the segment time with the given index. If it doesn't exist, nothing is done.

pub fn clear(&mut self)[src]

Removes all the segment times from the Segment History.

pub fn retain<F>(&mut self, f: F) where
    F: FnMut(&(i32, Time)) -> bool
[src]

Removes all the segment times from the Segment History, where the given closure returns false.

pub fn iter(&self) -> Iter<(i32, Time)>[src]

Iterates over all the segment times and their indices.

pub fn iter_mut(&mut self) -> IterMut<(i32, Time)>[src]

Mutably iterates over all the segment times and their indices.

Warning

While you are allowed to change the indices, you need to ensure they stay in rising order.

pub fn iter_actual_runs(&self) -> Iter<(i32, Time)>[src]

Iterates over the actual segment times achieved by the runner. Segment times created by route changes or other algorithmic changes are filtered out.

Trait Implementations

impl Default for SegmentHistory[src]

impl Clone for SegmentHistory[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialEq<SegmentHistory> for SegmentHistory[src]

impl<'a> IntoIterator for &'a SegmentHistory[src]

type Item = &'a (i32, Time)

The type of the elements being iterated over.

type IntoIter = Iter<'a, (i32, Time)>

Which kind of iterator are we turning this into?

impl Debug for SegmentHistory[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

fn adapt_into(self) -> D[src]

Convert the source color to the destination color using the bradford method by default Read more

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.