pub struct RetryPolicy {
pub attempts: u32,
pub interval: Duration,
}Expand description
How often, and how far apart, transaction-related messages are retried.
Both 1.6 (§3.7.1, TransactionMessageAttempts / TransactionMessageRetryInterval) and
2.x (OCPPCommCtrlr.MessageAttempts[TransactionEvent] /
MessageAttemptInterval[TransactionEvent]) prescribe the same linear schedule: wait
interval × number of preceding transmissions before each retry. It is not exponential,
and it applies to transaction messages only.
Fields§
§attempts: u32Total number of transmissions, including the first. 1 disables retrying.
interval: DurationThe base interval.
Implementations§
Source§impl RetryPolicy
impl RetryPolicy
Sourcepub fn delay_after(&self, attempts_made: u32) -> Duration
pub fn delay_after(&self, attempts_made: u32) -> Duration
The wait before the retry that follows attempts_made transmissions.
interval × attempts_made, per 1.6 §3.7.1 (“wait the retry interval multiplied by
the number of preceding transmissions”).
Trait Implementations§
Source§impl Clone for RetryPolicy
impl Clone for RetryPolicy
impl Copy for RetryPolicy
Source§impl Debug for RetryPolicy
impl Debug for RetryPolicy
Source§impl Default for RetryPolicy
impl Default for RetryPolicy
impl Eq for RetryPolicy
Source§impl PartialEq for RetryPolicy
impl PartialEq for RetryPolicy
impl StructuralPartialEq for RetryPolicy
Auto Trait Implementations§
impl Forget for RetryPolicy
impl Freeze for RetryPolicy
impl RefUnwindSafe for RetryPolicy
impl Send for RetryPolicy
impl Sync for RetryPolicy
impl Unpin for RetryPolicy
impl UnsafeUnpin for RetryPolicy
impl UnwindSafe for RetryPolicy
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