[−][src]Struct rosu::backend::UserRequest
Request struct to retrieve users. An instance must contain either a user id or a username
Methods
impl<'s> UserRequest<'s>
[src]
pub fn with_user_id(id: u32) -> Self
[src]
Construct a UserRequest
via user id
pub fn with_username(name: &str) -> Self
[src]
Construct a UserRequest
via username
pub fn mode(self, mode: GameMode) -> Self
[src]
Specify a game mode for the request
pub fn event_days(self, amount: u32) -> Self
[src]
Specify event days for the request.
From osu!api repo: Max number of days between now and last event date. Range of 1-31. Optional, default value is 1
pub async fn queue<'_>(self, osu: &'_ Osu) -> OsuResult<Vec<User>>
[src]
Asynchronously send the user request and await the parsed Vec<User>
.
Example
use rosu::{ backend::{Osu, requests::UserRequest}, models::User, }; let osu = Osu::new("osu_api_key"); let request: UserRequest = UserRequest::with_username("Badewanne3"); let users: Vec<User> = request.queue(&osu).await?; // ...
pub async fn queue_single<'_>(self, osu: &'_ Osu) -> OsuResult<Option<User>>
[src]
Asynchronously send the user request and await the parsed User.
If the API's response contains more than one user, the method will return the last one.
If the API response contains no users, the method will return None
.
Example
use rosu::{ backend::{Osu, requests::UserRequest}, models::User, }; let osu = Osu::new("osu_api_key"); let request: UserRequest = UserRequest::with_username("Badewanne3"); let user: Option<User> = request.queue_single(&osu).await?; // ...
Trait Implementations
impl<'s> Clone for UserRequest<'s>
[src]
fn clone(&self) -> UserRequest<'s>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'s> Eq for UserRequest<'s>
[src]
impl<'s> PartialEq<UserRequest<'s>> for UserRequest<'s>
[src]
fn eq(&self, other: &UserRequest<'s>) -> bool
[src]
fn ne(&self, other: &UserRequest<'s>) -> bool
[src]
impl<'s> StructuralEq for UserRequest<'s>
[src]
impl<'s> StructuralPartialEq for UserRequest<'s>
[src]
Auto Trait Implementations
impl<'s> RefUnwindSafe for UserRequest<'s>
impl<'s> Send for UserRequest<'s>
impl<'s> Sync for UserRequest<'s>
impl<'s> Unpin for UserRequest<'s>
impl<'s> UnwindSafe for UserRequest<'s>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,