pub struct DynThrottle<'dynosaur_struct> { /* private fields */ }Expand description
Dyn-compatible wrapper for Throttle.
Implementations§
Source§impl<'dynosaur_struct> DynThrottle<'dynosaur_struct>
impl<'dynosaur_struct> DynThrottle<'dynosaur_struct>
Sourcepub fn new_box(
value: impl Throttle + 'dynosaur_struct,
) -> _Box<DynThrottle<'dynosaur_struct>>
pub fn new_box( value: impl Throttle + 'dynosaur_struct, ) -> _Box<DynThrottle<'dynosaur_struct>>
Create Box<DynThrottle> from a value implementing Throttle.
Sourcepub fn new_arc(
value: impl Throttle + 'dynosaur_struct,
) -> _Arc<DynThrottle<'dynosaur_struct>> ⓘ
pub fn new_arc( value: impl Throttle + 'dynosaur_struct, ) -> _Arc<DynThrottle<'dynosaur_struct>> ⓘ
Create Arc<DynThrottle> from a value implementing Throttle.
Sourcepub fn new_rc(
value: impl Throttle + 'dynosaur_struct,
) -> _Rc<DynThrottle<'dynosaur_struct>>
pub fn new_rc( value: impl Throttle + 'dynosaur_struct, ) -> _Rc<DynThrottle<'dynosaur_struct>>
Create Rc<DynThrottle> from a value implementing Throttle.
Sourcepub const fn from_box(
value: _Box<impl Throttle + 'dynosaur_struct>,
) -> _Box<DynThrottle<'dynosaur_struct>>
pub const fn from_box( value: _Box<impl Throttle + 'dynosaur_struct>, ) -> _Box<DynThrottle<'dynosaur_struct>>
Convert Box<impl Throttle> to Box<DynThrottle>.
Sourcepub const fn from_arc(
value: _Arc<impl Throttle + 'dynosaur_struct>,
) -> _Arc<DynThrottle<'dynosaur_struct>> ⓘ
pub const fn from_arc( value: _Arc<impl Throttle + 'dynosaur_struct>, ) -> _Arc<DynThrottle<'dynosaur_struct>> ⓘ
Convert Arc<impl Throttle> to Arc<DynThrottle>.
Sourcepub const fn from_rc(
value: _Rc<impl Throttle + 'dynosaur_struct>,
) -> _Rc<DynThrottle<'dynosaur_struct>>
pub const fn from_rc( value: _Rc<impl Throttle + 'dynosaur_struct>, ) -> _Rc<DynThrottle<'dynosaur_struct>>
Convert Rc<impl Throttle> to Rc<DynThrottle>.
Sourcepub const fn from_ref(
value: &(impl Throttle + 'dynosaur_struct),
) -> &DynThrottle<'dynosaur_struct>
pub const fn from_ref( value: &(impl Throttle + 'dynosaur_struct), ) -> &DynThrottle<'dynosaur_struct>
Convert &impl Throttle to &DynThrottle.
Sourcepub const fn from_mut(
value: &mut (impl Throttle + 'dynosaur_struct),
) -> &mut DynThrottle<'dynosaur_struct>
pub const fn from_mut( value: &mut (impl Throttle + 'dynosaur_struct), ) -> &mut DynThrottle<'dynosaur_struct>
Convert &mut impl Throttle to &mut DynThrottle.
Trait Implementations§
Source§impl<'dynosaur_struct> Throttle for DynThrottle<'dynosaur_struct>
impl<'dynosaur_struct> Throttle for DynThrottle<'dynosaur_struct>
Source§fn acquire(
&self,
meta: &RequestMeta<'_>,
) -> impl Future<Output = Result<Charge, Refused>> + Send
fn acquire( &self, meta: &RequestMeta<'_>, ) -> impl Future<Output = Result<Charge, Refused>> + Send
Wait until the request may be sent, and charge it. Read more
Source§fn observe(
&self,
charge: &Charge,
response: &ResponseMeta<'_>,
attempt: &AttemptInfo,
)
fn observe( &self, charge: &Charge, response: &ResponseMeta<'_>, attempt: &AttemptInfo, )
See a response to an attempt
acquire charged. Runs on every
response, before the policy decides. Records counts and tiers only.Auto Trait Implementations§
impl<'dynosaur_struct> !Freeze for DynThrottle<'dynosaur_struct>
impl<'dynosaur_struct> !RefUnwindSafe for DynThrottle<'dynosaur_struct>
impl<'dynosaur_struct> !Sized for DynThrottle<'dynosaur_struct>
impl<'dynosaur_struct> !Unpin for DynThrottle<'dynosaur_struct>
impl<'dynosaur_struct> !UnsafeUnpin for DynThrottle<'dynosaur_struct>
impl<'dynosaur_struct> !UnwindSafe for DynThrottle<'dynosaur_struct>
impl<'dynosaur_struct> Send for DynThrottle<'dynosaur_struct>
impl<'dynosaur_struct> Sync for DynThrottle<'dynosaur_struct>
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