Struct actify::ThrottleBuilder

source ·
pub struct ThrottleBuilder<C, T, F> { /* private fields */ }
Expand description

The throttle builder helps build a throttle to execute a method on the current state of an actor, based on the Frequency.

Implementations§

source§

impl<C, T, F> ThrottleBuilder<C, T, F>
where C: Send + Sync + 'static, T: Clone + Debug + Throttled<F> + Send + Sync + 'static, F: Clone + Send + Sync + 'static,

source

pub fn new( client: C, call: fn(_: &C, _: F), freq: Frequency ) -> ThrottleBuilder<C, T, F>

source

pub fn init(self, val: T) -> Self

source

pub fn attach(self, handle: Handle<T>) -> Self

source

pub fn attach_rx(self, rx: Receiver<T>) -> Self

source

pub fn spawn(self) -> Result<(), ThrottleError>

Trait Implementations§

source§

impl<C, T, F> Debug for ThrottleBuilder<C, T, F>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<C, T, F> Freeze for ThrottleBuilder<C, T, F>
where C: Freeze, T: Freeze,

§

impl<C, T, F> !RefUnwindSafe for ThrottleBuilder<C, T, F>

§

impl<C, T, F> Send for ThrottleBuilder<C, T, F>
where C: Send, T: Send,

§

impl<C, T, F> Sync for ThrottleBuilder<C, T, F>
where C: Sync, T: Sync + Send,

§

impl<C, T, F> Unpin for ThrottleBuilder<C, T, F>
where C: Unpin, T: Unpin,

§

impl<C, T, F> !UnwindSafe for ThrottleBuilder<C, T, F>

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>,

§

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>,

§

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.