Struct Rate

pub struct Rate { /* private fields */ }

A rate of requests per time period.

Implementations

impl Rate

const fn new(num: u64, per: Duration) -> Self

Create a new rate.

Panics

This function panics if num or per is 0.

Trait Implementations

impl Clone for Rate

fn clone(&self) -> Self

impl Copy for Rate

impl Debug for Rate

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl Freeze for Rate

impl RefUnwindSafe for Rate

impl Send for Rate

impl Sync for Rate

impl Unpin for Rate

impl UnsafeUnpin for Rate

impl UnwindSafe for Rate

Blanket Implementations

impl<T> Any for Rate where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Rate where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Rate where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for Rate where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Rate

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> Instrument for Rate

impl<T> ToOwned for Rate where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> WithSubscriber for Rate

impl<T, U> Into<U> for Rate where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Rate where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Rate where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>