Struct splits_io_api::Segment

source ·
pub struct Segment {
Show 18 fields pub gametime_duration_ms: Option<f64>, pub gametime_end_ms: Option<f64>, pub gametime_gold: bool, pub gametime_reduced: bool, pub gametime_shortest_duration_ms: Option<f64>, pub gametime_skipped: bool, pub gametime_start_ms: Option<f64>, pub histories: Option<Vec<SegmentItemHistories>>, pub id: Uuid, pub name: Box<str>, pub realtime_duration_ms: f64, pub realtime_end_ms: f64, pub realtime_gold: bool, pub realtime_reduced: bool, pub realtime_shortest_duration_ms: Option<f64>, pub realtime_skipped: bool, pub realtime_start_ms: f64, pub segment_number: u32,
}
Expand description

A Segment maps to a single piece of a run, also called a split.

API Documentation

Fields§

§gametime_duration_ms: Option<f64>

Gametime duration in milliseconds of the segment.

§gametime_end_ms: Option<f64>

The total elapsed time of the run at the moment when this segment was finished in gametime (such that the run’s duration is equal to the final split’s finish time). Provided in milliseconds.

§gametime_gold: bool

Whether or not this split was the shortest duration the runner has ever gotten on this segment in gametime. This field is shorthand for duration == best.

§gametime_reduced: bool

Whether or not this segment was “reduced” in gametime; that is, had its duration affected by previous splits being skipped.

§gametime_shortest_duration_ms: Option<f64>

The shortest duration the runner has ever gotten on this segment in gametime. Provided in milliseconds.

§gametime_skipped: bool

Whether or not this split was skipped in gametime – some timers let the runner skip over a split in case they forgot to hit their split button on time. Beware that a skipped split’s duration is considered 0, and instead is rolled into the following split.

§gametime_start_ms: Option<f64>

The total elapsed time of the run at the moment when this segment was started in gametime. Provided in milliseconds.

§histories: Option<Vec<SegmentItemHistories>>

Ordered history objects of all previous attempts of the segment. The first item is the first run recorded by the runner’s timer into the source file. The last item is the most recent one. This field is only nonempty if the source timer records history.

§id: Uuid

Internal ID of the segment.

§name: Box<str>

Name of the segment. This value is an exact copy of timers’ fields.

§realtime_duration_ms: f64

Realtime duration in milliseconds of the segment.

§realtime_end_ms: f64

The total elapsed time of the run at the moment when this segment was finished in realtime (such that the run’s duration is equal to the final split’s finish time). Provided in milliseconds.

§realtime_gold: bool

Whether or not this split was the shortest duration the runner has ever gotten on this segment in realtime. This field is shorthand for realtime_duration_ms == realtime_shortest_duration_ms.

§realtime_reduced: bool

Whether or not this segment was “reduced” in realtime; that is, had its duration affected by previous splits being skipped.

§realtime_shortest_duration_ms: Option<f64>

The shortest duration the runner has ever gotten on this segment in realtime. Provided in milliseconds.

§realtime_skipped: bool

Whether or not this split was skipped in realtime – some timers let the runner skip over a split in case they forgot to hit their split button on time. Beware that a skipped split’s duration is considered 0, and instead is rolled into the following split.

§realtime_start_ms: f64

The total elapsed time of the run at the moment when this segment was started in realtime. Provided in milliseconds.

§segment_number: u32

The index of the segment within the run. (This value starts at 0.)

Trait Implementations§

source§

impl Debug for Segment

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Segment

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,