NagOptions
Configuration for Sponsorkit::nag.
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: StringA stable id for this nag (several nags can coexist).
every#
pub every: u64Due 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) -> SelfA nag due every every runs.
| Parameter | Type |
|---|---|
id | impl Into<String> |
every | u64 |
Returns: Self
or_every#
pub fn or_every(self, period: Duration) -> SelfAlso due when last shown at least period ago.
| Parameter | Type |
|---|---|
period | Duration |
Returns: Self
Trait implementations#
impl Clone for NagOptionsimpl Debug for NagOptions