pub struct ScoreMethods<'a, C>where
C: 'a,{ /* private fields */ }Expand description
A builder providing access to all methods supported on score resources.
It is not used directly, but through the Games hub.
§Example
Instantiate a resource builder
extern crate hyper;
extern crate hyper_rustls;
extern crate google_games1 as games1;
use games1::{Games, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
let secret: yup_oauth2::ApplicationSecret = Default::default();
let connector = hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_only()
.enable_http2()
.build();
let executor = hyper_util::rt::TokioExecutor::new();
let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
secret,
yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
yup_oauth2::client::CustomHyperClientBuilder::from(
hyper_util::client::legacy::Client::builder(executor).build(connector),
),
).build().await.unwrap();
let client = hyper_util::client::legacy::Client::builder(
hyper_util::rt::TokioExecutor::new()
)
.build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_or_http()
.enable_http2()
.build()
);
let mut hub = Games::new(client, auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `get(...)`, `list(...)`, `list_window(...)`, `submit(...)` and `submit_multiple(...)`
// to build up your call.
let rb = hub.scores();Implementations§
Source§impl<'a, C> ScoreMethods<'a, C>
impl<'a, C> ScoreMethods<'a, C>
Sourcepub fn get(
&self,
player_id: &str,
leaderboard_id: &str,
time_span: &str,
) -> ScoreGetCall<'a, C>
pub fn get( &self, player_id: &str, leaderboard_id: &str, time_span: &str, ) -> ScoreGetCall<'a, C>
Create a builder to help you perform the following task:
Get high scores, and optionally ranks, in leaderboards for the currently authenticated player. For a specific time span, leaderboardId can be set to ALL to retrieve data for all leaderboards in a given time span. `NOTE: You cannot ask for ‘ALL’ leaderboards and ‘ALL’ timeSpans in the same request; only one parameter may be set to ‘ALL’.
§Arguments
playerId- A player ID. A value ofmemay be used in place of the authenticated player’s ID.leaderboardId- The ID of the leaderboard. Can be set to ‘ALL’ to retrieve data for all leaderboards for this application.timeSpan- The time span for the scores and ranks you’re requesting.
Sourcepub fn list(
&self,
leaderboard_id: &str,
collection: &str,
time_span: &str,
) -> ScoreListCall<'a, C>
pub fn list( &self, leaderboard_id: &str, collection: &str, time_span: &str, ) -> ScoreListCall<'a, C>
Create a builder to help you perform the following task:
Lists the scores in a leaderboard, starting from the top.
§Arguments
leaderboardId- The ID of the leaderboard.collection- The collection of scores you’re requesting.timeSpan- Required. The time span for the scores and ranks you’re requesting.
Sourcepub fn list_window(
&self,
leaderboard_id: &str,
collection: &str,
time_span: &str,
) -> ScoreListWindowCall<'a, C>
pub fn list_window( &self, leaderboard_id: &str, collection: &str, time_span: &str, ) -> ScoreListWindowCall<'a, C>
Create a builder to help you perform the following task:
Lists the scores in a leaderboard around (and including) a player’s score.
§Arguments
leaderboardId- The ID of the leaderboard.collection- The collection of scores you’re requesting.timeSpan- Required. The time span for the scores and ranks you’re requesting.
Sourcepub fn submit(&self, leaderboard_id: &str, score: i64) -> ScoreSubmitCall<'a, C>
pub fn submit(&self, leaderboard_id: &str, score: i64) -> ScoreSubmitCall<'a, C>
Create a builder to help you perform the following task:
Submits a score to the specified leaderboard.
§Arguments
leaderboardId- The ID of the leaderboard.score- Required. The score you’re submitting. The submitted score is ignored if it is worse than a previously submitted score, where worse depends on the leaderboard sort order. The meaning of the score value depends on the leaderboard format type. For fixed-point, the score represents the raw value. For time, the score represents elapsed time in milliseconds. For currency, the score represents a value in micro units.
Sourcepub fn submit_multiple(
&self,
request: PlayerScoreSubmissionList,
) -> ScoreSubmitMultipleCall<'a, C>
pub fn submit_multiple( &self, request: PlayerScoreSubmissionList, ) -> ScoreSubmitMultipleCall<'a, C>
Create a builder to help you perform the following task:
Submits multiple scores to leaderboards.
§Arguments
request- No description provided.