Struct rosu_v2::Osu

source · []
pub struct Osu { /* private fields */ }
Expand description

The main osu client. Cheap to clone.

Implementations

Create a new default Osu client.

Errors if the API did not provide a token for the given client id and client secret.

Fine-tune building an Osu client.

Get a Beatmap.

Filled options will be: deleted_at (if deleted), fail_times, mapset and max_combo (if available for mode).

The contained Beatmapset will have these options filled: legacy_thread_url, ratings, ranked_date (if not unranked) and submitted_date (if submitted).

Get a vec of at most 50 BeatmapCompacts.

The contained maps will have these options filled: mapset, fail_times, and max_combo (if available for mode).

Get a vec of Score.

The contained scores will have the following options filled: map, pp (if ranked or approved), and user.

The scores’ contained UserCompact will have the country and cover options filled.

Get a BeatmapUserScore.

The contained Score will have the map and user options filled.

Get a vec of Score.

The contained scores won’t have any Options filled except for pp in case of a ranked map.

Get a Beatmapset.

Filled options will be: artist_unicode, converts, description, genre, language, legacy_thread_url, maps, ratings, ranked_date (if not unranked), recent_favourites, submitted_date (if submitted), and title_unicode.

The contained Beatmaps will contain Some in fail_times, max_combo (if available for mode), and deleted_at (if deleted).

Get a BeatmapsetEvents struct containing the most recent mapset events.

Get a BeatmapsetSearchResult struct containing the first page of maps that fit the search query.

The default search parameters are:

  • mode: any
  • status: has leaderboard (ranked, loved, approved, and qualified)
  • genre: any
  • language: any
  • extra: contains neither video nor storyboard
  • nsfw: allowed
  • sort: by relevance, descending

The contained Beatmapsets will have the following options filled: artist_unicode, legacy_thread_url, maps, ranked_date and submitted_date if available, and title_unicode.

The search query allows the following options to be specified: ar, artist, bpm, created, creator, cs, dr (hp drain rate), keys, length, ranked, stars, and status.

Example
// Search for mapsets from Sotarks that have a map with no more than AR 9.
let query = "creator=sotarks ar<9";

// Loved mapsets from Camellia including at least one map above 8 stars
let query = "status=loved artist=camellia stars>8";

Get a list of comments and their replies up to two levels deep in form of a CommentBundle .

Get a ChartRankings struct containing a Spotlight, its Beatmapsets, and participating UserCompact.

The mapset will have their maps option filled.

The user statistics contain specific, spotlight related data. All fields depends only on scores on maps of the spotlight. The statistics vector is ordered by ranked_score. The user option is filled.

Get a CountryRankings struct containing a vec of CountryRankings which will be sorted by the country’s total pp.

Get a ForumPosts struct for a forum topic

Get the kudosu history of a user in form of a vec of KudosuHistory.

Get News.

Get an OsuMatch.

Get a MatchList containing all currently open multiplayer lobbies.

Get the User of the authenticated user.

Note that the client has to be initialized with the identify scope through the OAuth process in order for this endpoint to not return an error.

See OsuBuilder::with_authorization.

Get a Rankings struct whose UserCompacts are sorted by their pp, i.e. the current pp leaderboard.

Get the recent activity of a user in form of a vec of RecentEvents.

Get a Score struct.

The contained score will have the following options filled: map (will contain checksum and max_combo), mapset (will contain artist_unicode and title_unicode), pp (if ranked), rank_global (if on leaderboard map) and user (will contain last_visited, country, cover and groups)

Get a Rankings struct whose UserCompacts are sorted by their ranked score, i.e. the current ranked score leaderboard.

Get the vec of Spotlight.

Get a User.

The following options will be filled if the user specified them: discord, interests, location, occupation, playstyle, profile_color, skype, title, title_url, website

The only is_* options that will be filled are is_active, is_bot, is_deleted, is_online, and is_supporter, the others won’t be.

All other options will be filled.

Get a vec of Beatmapsets a user made.

Filled options will be: artist_unicode, legacy_thread_url, maps, title_unicode.

All options of the contained Beatmaps will be None.

Get a vec of a user’s MostPlayedMaps.

All options of the contained BeatmapCompact and BeatmapsetCompact will be None.

Limit

The API provides at most 100 results, defaults to 5.

Get either top, global firsts, pinned, or recent scores of a user, i.e. a vec of Score.

If no score type is specified by either best, firsts, pinned, or recent, it defaults to best.

The resulting scores will have these options filled: map, mapset, pp, user

Additionally, the best score type will provide the weight option.

All options of the contained Beatmap, BeatmapsetCompact, and UserCompact will be None.

Note
  • The API provides at most 100 results per requests and defaults to 5.
  • For the recent score type, failed score are excluded by default. Use include_fails to include them.
  • For the firsts score type, pp will only be Some if the map is not loved.
👎 Deprecated:

The API currently doesn’t allow this endpoint for public use

Get a vec of UserCompact.

Get a WikiPage or image data.

locale adjusts the language, e.g. en for english, de for german, …

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more