pub type TokenAcquisitionResult = Result<f64, f64>;
Expand description

Represents the acquisition result from a call to TokenBucket.acquire().

Err() is called if the number of tokens desired is not currently available in the bucket. Otherwise, Ok() is called.

Both Ok() and Err() will supply the current rate of the Bucket in tokens acquired per second.

Aliased Type§

enum TokenAcquisitionResult {
    Ok(f64),
    Err(f64),
}

Variants§

§1.0.0

Ok(f64)

Contains the success value

§1.0.0

Err(f64)

Contains the error value