pub struct OsuBuilder { /* private fields */ }
Expand description

Builder struct for an Osu client.

client_id as well as client_secret must be specified before building.

For more info, check out https://osu.ppy.sh/docs/index.html#client-credentials-grant

Implementations

Create a new OsuBuilder

Build an Osu client.

To build the client, the client id and secret are being used to acquire a token from the API which expires after a certain time. The client will from then on update the token regularly on its own.

Errors

Returns an error if

  • client id was not set
  • client secret was not set
  • API did not provide a token for the given client id and client secret

Set the client id of the application.

For more info, check out https://osu.ppy.sh/docs/index.html#client-credentials-grant

Set the client secret of the application.

For more info, check out https://osu.ppy.sh/docs/index.html#client-credentials-grant

After acquiring the authorization code from a user through OAuth, use this method to provide the given code, and specified redirect uri.

For more info, check out https://osu.ppy.sh/docs/index.html#authorization-code-grant

Set the timeout for HTTP requests, defaults to 10 seconds.

Trait Implementations

Returns the “default value” for a 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