pub fn new(max_token_count: usize, refill_rate: usize) -> Self {
        let mut result = Self {
            last_refill: Instant::now(),
            max_token_count,
            refill_rate,
            current_size: 0,
            smallest_size: 0,
        };

        result.reset(max_token_count, refill_rate);
        result
    }
/**
     * Set up a token bucket.
     * @param max_token_count Maximum number of tokens in this bucket, which limits bursts.
     * @param refill_rate Token refill rate, which limits the long term rate (tokens per seconds)
     */
Set up a token bucket.
@param max_token_count Maximum number of tokens in this bucket, which limits bursts.
@param refill_rate Token refill rate, which limits the long term rate (tokens per seconds)
Set up a token bucket . @param max_token_count Maximum number of tokens in this bucket which limits bursts . @param refill_rate Token refill rate which limits the long term rate ( tokens per seconds )
pub fn new(max_token_count: usize, refill_rate: usize) -> Self {
        let mut result = Self {
            last_refill: Instant::now(),
            max_token_count,
            refill_rate,
            current_size: 0,
            smallest_size: 0,
        };
        result.reset(max_token_count, refill_rate);
        result
    }
pub fn new ( max_token_count : usize , refill_rate : usize ) -> Self { let mut result = Self { last_refill : Instant :: now ( ) , max_token_count , refill_rate , current_size : 0 , smallest_size : 0 , } ; result . reset ( max_token_count , refill_rate ) ; result }
Set up a token bucket.
Set up a token bucket .
max_token_count
usize
refill_rate
usize
max_token_count
usize
refill_rate
usize