Change docstring from multi- to singleline

This commit is contained in:
Flori Weber 2023-06-20 22:20:06 +02:00
parent 304cb6076a
commit 915c9be4ad
No known key found for this signature in database
GPG Key ID: 0ACD574FCF5226CF
1 changed files with 28 additions and 30 deletions

View File

@ -19,36 +19,34 @@ pub struct TypedRequest {
pub struct LimitedRequester; pub struct LimitedRequester;
impl LimitedRequester { impl LimitedRequester {
/** /// Checks if a request can be sent without hitting API rate limits and sends it, if true.
# send_request /// Will automatically update the rate limits of the LimitedRequester the request has been
Checks, if a request can be sent without hitting API rate limits and sends it, if true. /// sent with.
Will automatically update the rate limits of the LimitedRequester the request has been ///
sent with. /// # Arguments
///
## Arguments /// * `request`: A `RequestBuilder` that contains a request ready to be sent. Unfinished or
- `request`: A [`RequestBuilder`](reqwest::RequestBuilder) that contains a request ready to be /// invalid requests will result in the method panicing.
sent. Unfinished or invalid requests will result in the method panicing. /// * `limit_type`: Because this library does not yet implement a way to check for which rate
- `limit_type`: Because this library does not yet implement a way to check for which rate limit /// limit will be used when the request gets send, you will have to specify this manually using
will be used when the request gets send, you will have to specify this manually using a /// a `LimitType` enum.
[`LimitType`](crate::api::limits::LimitType) enum. ///
/// # Returns
## Returns ///
- `Response`: The [`Response`](`reqwest::Response`) gotten from sending the request to the /// * `Response`: The `Response` gotten from sending the request to the server. This will be
server. This will be returned if the Request was built and send successfully. Is wrapped in /// returned if the Request was built and send successfully. Is wrapped in an `Option`.
an [`Option`](`core::option::Option`) /// * `None`: `None` will be returned if the rate limit has been hit, and the request could
- `None`: [`None`](`core::option::Option`) will be returned if the rate limit has been hit, and /// therefore not have been sent.
the request could therefore not have been sent. ///
/// # Errors
## Errors ///
/// This method will error if:
This method will error, if: ///
- The request does not return a success status code (200-299) /// * The request does not return a success status code (200-299)
- The supplied [`RequestBuilder`](reqwest::RequestBuilder) contains invalid or incomplete /// * The supplied `RequestBuilder` contains invalid or incomplete information
information /// * There has been an error with processing (unwrapping) the `Response`
- There has been an error with processing (unwrapping) the [`Response`](`reqwest::Response`) /// * The call to `update_limits` yielded errors. Read the methods' Errors section for more
- The call to [`update_limits`](`crate::limits::update_limits`) yielded errors. Read the /// information.
methods' Errors section for more information.
*/
pub async fn send_request( pub async fn send_request(
request: RequestBuilder, request: RequestBuilder,
limit_type: LimitType, limit_type: LimitType,