pub struct Rate {
pub period: Duration,
}
Fields§
§period: Duration
Implementations§
Source§impl Rate
impl Rate
pub fn per_day(n: i64) -> Rate
pub fn per_hour(n: i64) -> Rate
pub fn per_minute(n: i64) -> Rate
Sourcepub fn per_period(n: i64, period: Duration) -> Rate
pub fn per_period(n: i64, period: Duration) -> Rate
Produces a rate for some number of actions per second. For example, if we wanted to have 10 actions every 2 seconds, the period produced would be 200 ms.
pub fn per_second(n: i64) -> Rate
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rate
impl RefUnwindSafe for Rate
impl Send for Rate
impl Sync for Rate
impl Unpin for Rate
impl UnwindSafe for Rate
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