Struct rosu_v2::OsuBuilder[][src]

pub struct OsuBuilder { /* fields omitted */ }
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

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

Performs the conversion.

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

Performs the conversion.

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.