Struct rosu_render::client::OrdrClientBuilder
source · 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 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