fn make_bucket(
        total_capacity: u64,
        one_time_burst: Option<u64>,
        complete_refill_time_ms: u64,
    ) -> Option<TokenBucket> {
        // If either token bucket capacity or refill time is 0, disable limiting.
        if total_capacity != 0 && complete_refill_time_ms != 0 {
            Some(TokenBucket::new(
                total_capacity,
                one_time_burst,
                complete_refill_time_ms,
            ))
        } else {
            None
        }
    }
/// This function creates a `TokenBucket` wrapped in an `Option` with a given total capacity,
/// one time burst, and complete refill time (in miliseconds). If the total capacity or the
/// complete refill time are zero, then `None` is returned.
This function creates a `TokenBucket` wrapped in an `Option` with a given total capacity,
one time burst, and complete refill time (in miliseconds). If the total capacity or the
complete refill time are zero, then `None` is returned.
This function creates a ` TokenBucket ` wrapped in an ` Option ` with a given total capacity one time burst and complete refill time ( in miliseconds ) . If the total capacity or the complete refill time are zero then ` None ` is returned .
fn make_bucket(
        total_capacity: u64,
        one_time_burst: Option<u64>,
        complete_refill_time_ms: u64,
    ) -> Option<TokenBucket> {
        // If either token bucket capacity or refill time is 0, disable limiting.
        if total_capacity != 0 && complete_refill_time_ms != 0 {
            Some(TokenBucket::new(
                total_capacity,
                one_time_burst,
                complete_refill_time_ms,
            ))
        } else {
            None
        }
    }
fn make_bucket ( total_capacity : u64 , one_time_burst : Option < u64 > , complete_refill_time_ms : u64 , ) -> Option < TokenBucket > { // If either token bucket capacity or refill time is 0, disable limiting. if total_capacity != 0 && complete_refill_time_ms != 0 { Some ( TokenBucket :: new ( total_capacity , one_time_burst , complete_refill_time_ms , ) ) } else { None } }
This function creates a `TokenBucket` wrapped in an `Option` with a given total capacity,
one time burst, and complete refill time (in miliseconds).
This function creates a ` TokenBucket ` wrapped in an ` Option ` with a given total capacity one time burst and complete refill time ( in miliseconds ) .
total_capacity
u64
one_time_burst
Option<u64>
complete_refill_time_ms
u64
total_capacity
u64
one_time_burst
Option<u64>
complete_refill_time_ms
u64