Struct Throttle

Source
pub struct Throttle<R, T, Fut>
where R: Runtime, T: Send + 'static, Fut: Future<Output = T> + Send + 'static,
{ /* private fields */ }
Expand description

Throttles a function call.

Implementations§

Source§

impl<R, T, Fut> Throttle<R, T, Fut>
where R: Runtime, T: Send + 'static, Fut: Future<Output = T> + Send + 'static,

Source

pub fn new<F>(duration: Duration, f: F) -> Self
where F: Fn(AppHandle<R>) -> Fut + Send + Sync + 'static,

Source

pub fn call(&self, app: &AppHandle<R>)

Source

pub fn abort(&self)

Trait Implementations§

Source§

impl<R, T, Fut> Drop for Throttle<R, T, Fut>
where R: Runtime, T: Send + 'static, Fut: Future<Output = T> + Send + 'static,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<R, T, Fut> RemoteCallable<AppHandle<R>> for Throttle<R, T, Fut>
where R: Runtime, T: Send + 'static, Fut: Future<Output = T> + Send + 'static,

Source§

fn call(&self, app: &AppHandle<R>)

Call the function with the provided context.
Source§

fn abort(&self)

Abort any pending calls.

Auto Trait Implementations§

§

impl<R, T, Fut> Freeze for Throttle<R, T, Fut>

§

impl<R, T, Fut> !RefUnwindSafe for Throttle<R, T, Fut>

§

impl<R, T, Fut> Send for Throttle<R, T, Fut>

§

impl<R, T, Fut> Sync for Throttle<R, T, Fut>

§

impl<R, T, Fut> Unpin for Throttle<R, T, Fut>

§

impl<R, T, Fut> !UnwindSafe for Throttle<R, T, Fut>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,