Struct splits_io_api::Run

source ·
pub struct Run {
Show 18 fields pub attempts: Option<u32>, pub category: Option<Category>, pub created_at: Box<str>, pub default_timing: Box<str>, pub game: Option<Game>, pub gametime_duration_ms: Option<f64>, pub gametime_sum_of_best_ms: Option<f64>, pub histories: Option<Vec<RunItemHistories>>, pub id: Option<Box<str>>, pub image_url: Option<Box<str>>, pub program: Box<str>, pub realtime_duration_ms: Option<f64>, pub realtime_sum_of_best_ms: Option<f64>, pub runners: Vec<Runner>, pub segments: Vec<Segment>, pub srdc_id: Option<Box<str>>, pub updated_at: Box<str>, pub video_url: Option<Box<str>>,
}
Expand description

A Run maps 1:1 to an uploaded splits file.

API Documentation

Fields§

§attempts: Option<u32>

The number of run attempts recorded by the timer that generated the run’s source file, if supported by the source timer.

§category: Option<Category>

The category which was run, if it was supplied by the runner and determined from the source file.

§created_at: Box<str>

The time and date at which this run’s source file was uploaded to splits.io. This field conforms to ISO 8601.

§default_timing: Box<str>

The timing method used for the run. Will be either real or game.

§game: Option<Game>

The game which was run, if it was supplied by the runner and determined from the source file.

§gametime_duration_ms: Option<f64>

Gametime duration in milliseconds of the run.

§gametime_sum_of_best_ms: Option<f64>

Gametime sum of best in milliseconds of the run.

§histories: Option<Vec<RunItemHistories>>

Ordered history objects of all previous attempts. 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: Option<Box<str>>

Unique ID for identifying the run on splits.io. This can be used to construct a user-facing URL or an API-facing one.

§image_url: Option<Box<str>>

A screenshot of the timer after a finished run, if it was supplied by the runner. This is typically supplied automatically by timers which support auto-uploading runs to splits.io.

§program: Box<str>

The name of the timer with which the run was recorded. This is typically an all lowercase, no-spaces version of the program name.

§realtime_duration_ms: Option<f64>

Realtime duration in milliseconds of the run.

§realtime_sum_of_best_ms: Option<f64>

Realtime sum of best in milliseconds of the run.

§runners: Vec<Runner>

The runner(s) who performed the run, if they claim credit.

§segments: Vec<Segment>

The associated segments for the run.

§srdc_id: Option<Box<str>>

Unique ID for identifying the run on Speedrun.com. This is typically supplied by the runner manually.

§updated_at: Box<str>

The time and date at which this run was most recently modified on splits.io (modify events include disowning, adding a video or Speedrun.com association, and changing the run’s game/category). This field conforms to ISO 8601.

§video_url: Option<Box<str>>

A URL for a Twitch, YouTube, or Hitbox video which can be used as proof of the run. This is supplied by the runner.

Implementations§

source§

impl Run

source

pub async fn download( &self, client: &Client ) -> Result<impl Deref<Target = [u8]>, Error>

Downloads the splits for the Run.

source

pub async fn get( client: &Client, id: &str, historic: bool ) -> Result<Run, Error>

Gets a Run.

source

pub async fn upload(client: &Client, run: Vec<u8>) -> Result<UploadedRun, Error>

Uploads a run to splits.io.

source

pub fn url(&self) -> Result<Url, Error>

Retrieves the public URL of the run. This may fail if the run is unidentifiable.

Trait Implementations§

source§

impl Debug for Run

source§

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

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

impl<'de> Deserialize<'de> for Run

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§

§

impl RefUnwindSafe for Run

§

impl Send for Run

§

impl Sync for Run

§

impl Unpin for Run

§

impl UnwindSafe for Run

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>,