Function u_interface::get_ranking
source · [−]pub(crate) async fn get_ranking(
uid: u32,
above: u16,
below: u16
) -> Result<Vec<UserRank>, ExitFailure>
Expand description
Returns a Vector containing the Rank of the above
users over the user
with id uid
, the user with that id and the below
users, below the
asme user. This function is async, that means it has to be called
inside an async function/method or using tokio::Runtime.block_on()
.
Arguments
uid
- An unsigned, 32 bit number indicating the id of the user.above
- An unsigned, 16 bit number indicating the number of users to show above user wit idpid
.below
- An unsigned, 16 bit number indicating the number of users to show below user wit idpid
.
Examples
// Return the 2 users' rankings above and below the user LovetheFrogs
let uranking: Vec<UserRank> = get_ranking(1589052, 2, 2).await?;