wrote crate level docs

This commit is contained in:
MaxOhn
2024-02-10 04:44:36 +01:00
parent c793361e0f
commit 5f052f5674
2 changed files with 97 additions and 193 deletions
+29 -11
View File
@@ -3,16 +3,27 @@
//! ## Description
//!
//! A large part of `rosu-pp` is a port of [osu!lazer]'s difficulty and performance calculation
//! with emphasis on a precise translation to rust for the most accurate results.
//! with emphasis on a precise translation to Rust for the most accurate results.
//!
//! Another important factor is the calculation speed. Optimizations and an accurate translation
//! unfortunately don't always go hand-in-hand. Nonetheless, performance improvements are still
//! snuck in wherever possible, providing a significantly faster runtime than the native C# code.
//!
//! TODO: values to compare
//!
//! Additionally, `rosu-pp` allows previous values to be re-used so that they don't need to be
//! calculated again. For example, a beatmap needs to be decoded only once and can then be used
//! for any amount of attribute calculations. Similarly, previous attributes can be re-used for
//! later calculations (with some limitations, see the [example](#usage)).
//!
//! Last commits of the ported code:
//! - [osu!lazer]: `7342fb7f51b34533a42bffda89c3d6c569cc69ce` (2022-10-11)
//! - [osu!tools]: `146d5916937161ef65906aa97f85d367035f3712` (2022-10-08)
//!
//! Posts of the latest gamemode updates:
//! News posts of the latest gamemode updates:
//! - osu: <https://osu.ppy.sh/home/news/2022-09-30-changes-to-osu-sr-and-pp>
//! - taiko: <https://osu.ppy.sh/home/news/2022-09-28-changes-to-osu-taiko-sr-and-pp>
//! - catch: TODO
//! - catch: <https://osu.ppy.sh/home/news/2020-05-14-osucatch-scoring-updates>
//! - mania: <https://osu.ppy.sh/home/news/2022-10-09-changes-to-osu-mania-sr-and-pp>
//!
//! ## Usage
@@ -30,13 +41,12 @@
//!
//! // Calculate performance attributes
//! let perf_attrs = map.performance()
//! // To speed up the calculation significantly, we can re-use the previous
//! // attributes.
//! // **Note** that this should only be done if the map, mode, mods, and
//! // amount of passed objects stay the same. Otherwise, the resulting
//! // attributes will be incorrect.
//! // To speed up the calculation, we can use the previous attributes.
//! // **Note** that this should only be done if the map, mode, mods,
//! // clock rate, and amount of passed objects stay the same.
//! // Otherwise, the final attributes will be incorrect.
//! .attributes(diff_attrs)
//! .mods(24) // HDHR, same as before
//! .mods(24) // HDHR, must be the same as before
//! .combo(789)
//! .accuracy(99.2)
//! .misses(2)
@@ -60,15 +70,23 @@
//!
//! ## Features
//!
//! | Flag | Description | Dependencies
//! | - | - | -
//! | Flag | Description | Dependencies
//! | --------- | ----------- | ------------
//! | `default` | No features |
//! | `tracing` | Any error encountered during beatmap decoding will be logged through `tracing::error`. If this features is not enabled, errors will be ignored. | [`tracing`]
//!
//! ## Bindings
//!
//! Using `rosu-pp` from other languages than Rust:
//! - JavaScript: [rosu-pp-js]
//! - Python: [rosu-pp-py]
//!
//! [osu!]: https://osu.ppy.sh/home
//! [osu!lazer]: https://github.com/ppy/osu
//! [osu!tools]: https://github.com/ppy/osu-tools
//! [`tracing`]: https://docs.rs/tracing
//! [rosu-pp-js]: https://github.com/MaxOhn/rosu-pp-js
//! [rosu-pp-py]: https://github.com/MaxOhn/rosu-pp-py
#![deny(rustdoc::broken_intra_doc_links)]
#![warn(clippy::missing_const_for_fn, clippy::pedantic)]