Struct speedrun_api::api::games::GameRecordsBuilder
source · [−]pub struct GameRecordsBuilder<'a> { /* private fields */ }Expand description
Builder for GameRecords.
Implementations
sourceimpl<'a> GameRecordsBuilder<'a>
impl<'a> GameRecordsBuilder<'a>
sourcepub fn id<VALUE: Into<GameId<'a>>>(&mut self, value: VALUE) -> &mut Self
pub fn id<VALUE: Into<GameId<'a>>>(&mut self, value: VALUE) -> &mut Self
ID of the game to retrieve records for.
sourcepub fn top<VALUE: Into<i64>>(&mut self, value: VALUE) -> &mut Self
pub fn top<VALUE: Into<i64>>(&mut self, value: VALUE) -> &mut Self
Return the top places (this can result in more than top runs!). Defaults to 3.
sourcepub fn scope<VALUE: Into<LeaderboardScope>>(&mut self, value: VALUE) -> &mut Self
pub fn scope<VALUE: Into<LeaderboardScope>>(&mut self, value: VALUE) -> &mut Self
When set to LeaderboardScope::FullGame, only full-game categories will be included. When set to LeaderboardScope::Levels only individual levels are returned. Defaults to LeaderboardScope::All.
sourcepub fn miscellaneous<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn miscellaneous<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
When false, miscellaneous categories will not be included in the results.
sourcepub fn skip_empty<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn skip_empty<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
When true, empty leaderboards will not be included in the results.
sourcepub fn build(&self) -> Result<GameRecords<'a>, GameRecordsBuilderError>
pub fn build(&self) -> Result<GameRecords<'a>, GameRecordsBuilderError>
sourceimpl<'a> GameRecordsBuilder<'a>
impl<'a> GameRecordsBuilder<'a>
sourcepub fn embed(&mut self, embed: LeaderboardEmbeds) -> &mut Self
pub fn embed(&mut self, embed: LeaderboardEmbeds) -> &mut Self
Add an embedded resource to this result.
sourcepub fn embeds<I>(&mut self, iter: I) -> &mut Selfwhere
I: Iterator<Item = LeaderboardEmbeds>,
pub fn embeds<I>(&mut self, iter: I) -> &mut Selfwhere
I: Iterator<Item = LeaderboardEmbeds>,
Add multiple embedded resources to this result.
Trait Implementations
sourceimpl<'a> Clone for GameRecordsBuilder<'a>
impl<'a> Clone for GameRecordsBuilder<'a>
sourcefn clone(&self) -> GameRecordsBuilder<'a>
fn clone(&self) -> GameRecordsBuilder<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl<'a> RefUnwindSafe for GameRecordsBuilder<'a>
impl<'a> Send for GameRecordsBuilder<'a>
impl<'a> Sync for GameRecordsBuilder<'a>
impl<'a> Unpin for GameRecordsBuilder<'a>
impl<'a> UnwindSafe for GameRecordsBuilder<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more