pub struct Scoreboards<Api = Default>(/* private fields */);
Implementations§
Source§impl Scoreboards<Default>
impl Scoreboards<Default>
Sourcepub fn Default() -> Self
pub fn Default() -> Self
Creates default Scoreboards
without type parameter requirement.
Uses ZST api::Default
.
Source§impl Scoreboards<Cache>
impl Scoreboards<Cache>
Sourcepub fn Cached() -> Self
pub fn Cached() -> Self
Creates Scoreboards
without type parameter requirement.
Uses api::Cache
.
Source§impl<Api: Api> Scoreboards<Api>
impl<Api: Api> Scoreboards<Api>
Sourcepub fn add_score<S: AsRef<str>, F>(
&self,
board_id: S,
value: u32,
callback: F,
) -> Result<Option<F>, ApiError>where
F: 'static + Send + FnMut(ScoresResult<ScoreRef>),
pub fn add_score<S: AsRef<str>, F>(
&self,
board_id: S,
value: u32,
callback: F,
) -> Result<Option<F>, ApiError>where
F: 'static + Send + FnMut(ScoresResult<ScoreRef>),
Requests to add score value
to the board with given board_id
.
Safety: read description for Scoreboards::get_scoreboards
.
Equivalent to sys::ffi::playdate_scoreboards::addScore
.
Sourcepub fn get_personal_best_for<F>(
&self,
board: &Board,
callback: F,
) -> Result<Option<F>, ApiError>where
F: 'static + Send + FnMut(ScoresResult<ScoreRef>),
pub fn get_personal_best_for<F>(
&self,
board: &Board,
callback: F,
) -> Result<Option<F>, ApiError>where
F: 'static + Send + FnMut(ScoresResult<ScoreRef>),
Requests user’s personal best scores for the given board
.
Safety: read description for Scoreboards::get_scoreboards
.
Equivalent to sys::ffi::playdate_scoreboards::getPersonalBest
.
Sourcepub fn get_personal_best<S: AsRef<str>, F>(
&self,
board_id: S,
callback: F,
) -> Result<Option<F>, ApiError>where
F: 'static + Send + FnMut(ScoresResult<ScoreRef>),
pub fn get_personal_best<S: AsRef<str>, F>(
&self,
board_id: S,
callback: F,
) -> Result<Option<F>, ApiError>where
F: 'static + Send + FnMut(ScoresResult<ScoreRef>),
Requests user’s personal best scores for the given board_id
.
Safety: read description for Scoreboards::get_scoreboards
.
Equivalent to sys::ffi::playdate_scoreboards::getPersonalBest
.
Sourcepub fn get_scores<S: AsRef<str>, F>(
&self,
board_id: S,
callback: F,
) -> Result<Option<F>, ApiError>where
F: 'static + Send + FnMut(ScoresResult<Scores>),
pub fn get_scores<S: AsRef<str>, F>(
&self,
board_id: S,
callback: F,
) -> Result<Option<F>, ApiError>where
F: 'static + Send + FnMut(ScoresResult<Scores>),
Requests scores list Scores
for the given board_id
.
Safety: read description for Scoreboards::get_scoreboards
.
Equivalent to sys::ffi::playdate_scoreboards::getScores
.
Sourcepub fn get_scoreboards<F>(&self, callback: F) -> Option<F>where
F: 'static + Send + FnMut(ScoresResult<Boards>),
pub fn get_scoreboards<F>(&self, callback: F) -> Option<F>where
F: 'static + Send + FnMut(ScoresResult<Boards>),
Requests boards list Boards
for the given board_id
.
Returns previous callback F
if it exists, so it was overwritten.
Usually, it’s not possible fo closures because until it’s type is not erased.
Anyway if it happened, we just override it with new one, given as callback
,
so responses will be passed to the new callback.
Equivalent to sys::ffi::playdate_scoreboards::getScoreboards
.
Trait Implementations§
Source§impl<Api: Clone> Clone for Scoreboards<Api>
impl<Api: Clone> Clone for Scoreboards<Api>
Source§fn clone(&self) -> Scoreboards<Api>
fn clone(&self) -> Scoreboards<Api>
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<Api: Debug> Debug for Scoreboards<Api>
impl<Api: Debug> Debug for Scoreboards<Api>
Source§impl<Api: Default + Api> Default for Scoreboards<Api>
impl<Api: Default + Api> Default for Scoreboards<Api>
impl<Api: Copy> Copy for Scoreboards<Api>
Auto Trait Implementations§
impl<Api> Freeze for Scoreboards<Api>where
Api: Freeze,
impl<Api> RefUnwindSafe for Scoreboards<Api>where
Api: RefUnwindSafe,
impl<Api> Send for Scoreboards<Api>where
Api: Send,
impl<Api> Sync for Scoreboards<Api>where
Api: Sync,
impl<Api> Unpin for Scoreboards<Api>where
Api: Unpin,
impl<Api> UnwindSafe for Scoreboards<Api>where
Api: UnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut u8)
unsafe fn clone_to_uninit(&self, dst: *mut u8)
clone_to_uninit
)§impl<T, U> Into<U> for Twhere
U: From<T>,
impl<T, U> Into<U> for Twhere
U: From<T>,
§impl<T> ToOwned for Twhere
T: Clone,
impl<T> ToOwned for Twhere
T: Clone,
§impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
impl<T, U> TryFrom<U> for Twhere
U: Into<T>,
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.