[][src]Struct livesplit_core::Attempt

pub struct Attempt { /* fields omitted */ }

An Attempt describes information about an attempt to run a specific category by a specific runner in the past. Every time a new attempt is started and then reset, an Attempt describing general information about it is created.

Methods

impl Attempt[src]

pub fn new(
    index: i32,
    time: Time,
    started: Option<AtomicDateTime>,
    ended: Option<AtomicDateTime>,
    pause_time: Option<TimeSpan>
) -> Self
[src]

Creates a new Attempt, logging an attempt to speedrun a category. You need the provide a unique index for the attempt (The index needs to be unique for the Run, not across all the Run objects). Additionally you provide the split time of the last segment. If it is empty, the attempt is considered being reset early. If there's information available about when the attempt was started and when it ended, this information can be provided. Both of these should be provided for unfinished attempts as well, if possible. If it is known that the attempt was paused for a certain amount of time, this can be provided as well.

pub fn duration(&self) -> Option<TimeSpan>[src]

Returns the total duration of the attempt, from the point in time it started to the point in time it ended. This is different from the real time of the run, as it includes all the pause times and the timer offset at the beginning of the run. If not enough information is known to derive this, the real time is used as a fallback. So if for example the timer started at -2s, the runner paused it for 5s and the timer ended at a real time value of 10s, then the actual duration of the attempt was 17s.

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

Accesses the unique index of the attempt. This index is unique for the Run, not for all of them.

pub fn time(&self) -> Time[src]

Accesses the split time of the last segment. If the attempt got reset early and didn't finish, this may be empty.

pub fn pause_time(&self) -> Option<TimeSpan>[src]

Accesses the amount of time the attempt has been paused for. If it is not known, this returns None. This means that it may not necessarily be possible to differentiate whether a Run has not been paused or it simply wasn't stored.

pub fn started(&self) -> Option<AtomicDateTime>[src]

Accesses the point in time the attempt was started at. This returns None if this information is not known.

pub fn ended(&self) -> Option<AtomicDateTime>[src]

Accesses the point in time the attempt was ended at. This returns None if this information is not known.

Trait Implementations

impl PartialEq<Attempt> for Attempt[src]

impl Clone for Attempt[src]

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

Performs copy-assignment from source. Read more

impl Debug for Attempt[src]

Auto Trait Implementations

impl Send for Attempt

impl Sync for Attempt

Blanket Implementations

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

type Owned = T

The resulting type after obtaining ownership.

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

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

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.