Skip to main content

RecurringSchedule

Struct RecurringSchedule 

Source
pub struct RecurringSchedule { /* private fields */ }
Expand description

Configures the schedule for a recurring timer.

Implementations§

Source§

impl RecurringSchedule

Source

pub fn new(interval: Duration) -> Self

Creates a recurring schedule from a fixed interval.

Source

pub fn interval(self) -> Duration

Returns the recurring interval.

Source

pub fn initial_delay(self) -> Option<Duration>

Returns the initial delay before the first execution.

Source

pub fn cadence(self) -> RecurringCadence

Returns the cadence used for the recurring schedule.

Source

pub fn expiration_count(self) -> Option<usize>

Returns the optional execution limit.

Source

pub fn jitter(self) -> Option<Duration>

Returns the optional jitter applied to recurring sleeps.

Source

pub fn with_initial_delay(self, initial_delay: Duration) -> Self

Sets an initial delay before the first recurring execution.

Source

pub fn with_cadence(self, cadence: RecurringCadence) -> Self

Sets the cadence used for subsequent executions.

Source

pub fn fixed_delay(self) -> Self

Uses fixed-delay cadence semantics.

Source

pub fn fixed_rate(self) -> Self

Uses fixed-rate cadence semantics.

Source

pub fn with_expiration_count(self, expiration_count: usize) -> Self

Limits the number of recurring executions.

Source

pub fn with_jitter(self, jitter: Duration) -> Self

Adds bounded jitter to recurring delays.

Trait Implementations§

Source§

impl Clone for RecurringSchedule

Source§

fn clone(&self) -> RecurringSchedule

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RecurringSchedule

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for RecurringSchedule

Source§

fn eq(&self, other: &RecurringSchedule) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for RecurringSchedule

Source§

impl Eq for RecurringSchedule

Source§

impl StructuralPartialEq for RecurringSchedule

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.