[−][src]Struct bouncer::Bouncer
Fields
key: u8
rate_limit: u8
wait_time: u8
block: &'a dyn Fn()
Implementations
impl<'a> Bouncer<'a>
[src]
pub fn new(block: &'a dyn Fn()) -> Bouncer<'_>
[src]
Returns a Bouncer instance
Arguments
block
- A block or a function that will execute a request to a third-party service.
pub fn key(&'a mut self, key: u8) -> &'a mut Bouncer<'_>
[src]
pub fn rate_limit(&'a mut self, rate_limit: u8) -> &'a mut Bouncer<'_>
[src]
Assigns a rate limit to the process to be executed.
Arguments
rate_limit
- limit the number of calls.
pub fn wait_time(&'a mut self, wait_time: u8) -> &'a mut Bouncer<'_>
[src]
Assigns a waiting time to the process to be executed.
Arguments
wait_time
- A value in seconds to wait until the next request to be executed.
pub fn run(&self) -> RedisResult<BouncerStats>
[src]
Executes the passed block.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Bouncer<'a>
impl<'a> !Send for Bouncer<'a>
impl<'a> !Sync for Bouncer<'a>
impl<'a> Unpin for Bouncer<'a>
impl<'a> !UnwindSafe for Bouncer<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,