pub struct OrdrClientBuilder { /* private fields */ }
Expand description
A builder for OrdrClient
.
Implementations§
Source§impl OrdrClientBuilder
impl OrdrClientBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new builder to create a OrdrClient
.
pub fn build(self) -> OrdrClient
Sourcepub fn verification(self, verification: Verification) -> Self
pub fn verification(self, verification: Verification) -> Self
Specify a Verification
Refer to its documentation for more information.
Sourcepub fn render_ratelimit(self, interval_ms: u64, refill: u64, max: u64) -> Self
pub fn render_ratelimit(self, interval_ms: u64, refill: u64, max: u64) -> Self
Specify a ratelimit that the client will uphold for the render endpoint. Other endpoints won’t be affected, they have a pre-set ratelimit.
interval_ms
: How many milliseconds until the next refillrefill
: How many allowances are added per refillmax
: What’s the maximum amount of available allowances
If no Verification
is specified, the ratelimit will be clamped up to one
per 5 minutes as per o!rdr rules.
If a dev mode Verification
is specified, the ratelimit defaults to one per second.
If a verification key is specified, the ratelimit defaults to one per 10 seconds.
§Panics
Panics if interval_ms
or refill
are zero.
§Example
use rosu_render::OrdrClient;
// Applying a ratelimit of 1 refill every 5 seconds, up to 2 charges
// which means 2 requests per 10 seconds.
let client = OrdrClient::builder()
.render_ratelimit(5000, 1, 2)
.build();
Trait Implementations§
Source§impl Default for OrdrClientBuilder
impl Default for OrdrClientBuilder
Source§fn default() -> OrdrClientBuilder
fn default() -> OrdrClientBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for OrdrClientBuilder
impl RefUnwindSafe for OrdrClientBuilder
impl Send for OrdrClientBuilder
impl Sync for OrdrClientBuilder
impl Unpin for OrdrClientBuilder
impl UnwindSafe for OrdrClientBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more