NagOptions

Configuration for Sponsorkit::nag.

On this page

Configuration for Sponsorkit::nag.

use sponsorkit::NagOptions;

pub struct NagOptions {
    pub id: String,
    pub every: u64,
    pub or_every: Option<Duration>,
}

Fields#

id#

pub id: String

A stable id for this nag (several nags can coexist).

every#

pub every: u64

Due after this many runs (processes) since it was last shown.

or_every#

pub or_every: Option<Duration>

Or due when it was last shown at least this long ago. Use crate::parse_iso_duration for ISO-8601 strings such as "P7D".

Methods#

new#

pub fn new(id: impl Into<String>, every: u64) -> Self

A nag due every every runs.

ParameterType
idimpl Into<String>
everyu64

Returns: Self

or_every#

pub fn or_every(self, period: Duration) -> Self

Also due when last shown at least period ago.

ParameterType
periodDuration

Returns: Self

Trait implementations#

  • impl Clone for NagOptions
  • impl Debug for NagOptions