pub struct Con {
pub unacked_retry_strategy: Strategy,
pub acked_retry_strategy: Strategy,
pub max_attempts: Attempts,
}
Expand description
Configuration options related to parsing & handling outbound CON requests
Fields§
§unacked_retry_strategy: Strategy
Retry strategy for CON requests that have not yet been ACKed.
Defaults to an exponential retry strategy:
use embedded_time::duration::Milliseconds;
use toad::config::Con;
use toad::retry::Strategy;
assert_eq!(Con::default().unacked_retry_strategy,
Strategy::Exponential { init_min: Milliseconds(500),
init_max: Milliseconds(1_000) });
acked_retry_strategy: Strategy
Retry strategy for CON requests that have been ACKed.
Usually this should be lazier than unacked_retry_strategy
,
since we can reasonably expect the duration between “received request”
and “responded with ACK” to be much shorter than “responded with ACK” and
“sent actual response.”
Defaults to a lazy exponential retry strategy:
use embedded_time::duration::Milliseconds;
use toad::config::Con;
use toad::retry::Strategy;
assert_eq!(Con::default().acked_retry_strategy,
Strategy::Exponential { init_min: Milliseconds(1_000),
init_max: Milliseconds(2_000) });
max_attempts: Attempts
Number of times we are allowed to resend a CON request before erroring. Defaults to 4 attempts.
use toad::config::Con;
use toad::retry::Attempts;
assert_eq!(Con::default().max_attempts, Attempts(4));
Trait Implementations§
source§impl Ord for Con
impl Ord for Con
source§impl PartialOrd<Con> for Con
impl PartialOrd<Con> for Con
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Con
impl Eq for Con
impl StructuralEq for Con
impl StructuralPartialEq for Con
Auto Trait Implementations§
impl RefUnwindSafe for Con
impl Send for Con
impl Sync for Con
impl Unpin for Con
impl UnwindSafe for Con
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
source§impl<F, A, TF, T> Sequence<F, A, TF> for T
impl<F, A, TF, T> Sequence<F, A, TF> for T
source§fn sequence<Ap>(self) -> <Ap as HKT1>::T<<F as HKT1>::T<A>>where
Self: Sized + Traversable<F, <Ap as HKT1>::T<A>, A, TF> + Foldable<F, <Ap as HKT1>::T<A>>,
Ap: HKT1,
<Ap as HKT1>::T<A>: Applicative<Ap, A> + ApplyOnce<Ap, A>,
<Ap as HKT1>::T<TF>: Applicative<Ap, TF> + ApplyOnce<Ap, TF>,
<Ap as HKT1>::T<<F as HKT1>::T<A>>: Applicative<Ap, <F as HKT1>::T<A>> + ApplyOnce<Ap, <F as HKT1>::T<A>>,
F: HKT1<T<<Ap as HKT1>::T<A>> = Self>,
fn sequence<Ap>(self) -> <Ap as HKT1>::T<<F as HKT1>::T<A>>where Self: Sized + Traversable<F, <Ap as HKT1>::T<A>, A, TF> + Foldable<F, <Ap as HKT1>::T<A>>, Ap: HKT1, <Ap as HKT1>::T<A>: Applicative<Ap, A> + ApplyOnce<Ap, A>, <Ap as HKT1>::T<TF>: Applicative<Ap, TF> + ApplyOnce<Ap, TF>, <Ap as HKT1>::T<<F as HKT1>::T<A>>: Applicative<Ap, <F as HKT1>::T<A>> + ApplyOnce<Ap, <F as HKT1>::T<A>>, F: HKT1<T<<Ap as HKT1>::T<A>> = Self>,
See
Sequence