EventTemplate

Struct EventTemplate 

Source
pub struct EventTemplate {
    pub name: String,
    pub desc: String,
    pub date_str: Option<String>,
    pub wait_expr: Option<String>,
    pub cron_str: Option<String>,
    pub icon_name: Option<String>,
    pub sound_path: Option<String>,
    pub announce: bool,
    pub test_sound: bool,
}
Expand description

Structure describing a notification

Fields§

§name: String

Title of the notification

§desc: String

Body of the notification message

§date_str: Option<String>

Optional specific datetime in the future with the format YYYY-mm-ddTHH:MM

§Example

  • 2023-10-03T15:00
§wait_expr: Option<String>

Optional duration expression that states a time span from now to now + duration as the waiting time until the notification is issued.

§Example

  • 5 min
  • 30 minutes
  • 20 seconds
  • 3 days
§cron_str: Option<String>

An optional cron pattern to store in the database for recurring events.

§Example

  • * */5 * * * * (Every 5 minutes)
  • * 30 16 * * * (Every day at 16:30)
§icon_name: Option<String>

Optional filename without extension or path of a specific icon, the icon must be placed within a folder that is known to the notification daemon.

§sound_path: Option<String>

Optional full-path to sound file (.mp3, .mpg, etc.)

§announce: bool

Decide whether to announce the notification in advance when either date_str, wait_expr, or cron_str are given, the announcement shows the content of the notification and might be used to test if the EventTemplate works as expected. When test_sound is true and the sound_path points to a valid file the sound is played during the announcement.

§test_sound: bool

Only works in combination with announce and sound_path, play the sound file during the announcement to check in advance if it works.

Trait Implementations§

Source§

impl Clone for EventTemplate

Source§

fn clone(&self) -> EventTemplate

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

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> Same for T

Source§

type Output = T

Should always be Self
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.