pub enum MonitorSchedule {
Crontab {
value: String,
},
Interval {
value: u64,
unit: MonitorIntervalUnit,
},
}
Expand description
Configuration object of the monitor schedule.
Variants§
Crontab
A Crontab schedule allows you to use a standard UNIX crontab style schedule string to configure when a monitor check-in will be expected on Sentry.
Interval
A Interval schedule allows you to configure a periodic check-in, that will occur at an interval after the most recent check-in.
Implementations§
Source§impl MonitorSchedule
impl MonitorSchedule
Sourcepub fn from_crontab(crontab_str: &str) -> Result<Self, CrontabParseError>
pub fn from_crontab(crontab_str: &str) -> Result<Self, CrontabParseError>
Attempts to create a MonitorSchedule from a provided crontab_str. If the crontab_str is a valid crontab schedule, we return a Result containing the MonitorSchedule; otherwise, we return a Result containing a CrontabParseError.
§Example with valid crontab
use sentry_types::protocol::v7::MonitorSchedule;
// Create a crontab that runs every other day of the month at midnight.
let result = MonitorSchedule::from_crontab("0 0 */2 * *");
assert!(result.is_ok())
§Example with an invalid crontab
use sentry_types::protocol::v7::MonitorSchedule;
// Invalid crontab.
let result = MonitorSchedule::from_crontab("invalid");
assert!(result.is_err());
Trait Implementations§
Source§impl Clone for MonitorSchedule
impl Clone for MonitorSchedule
Source§fn clone(&self) -> MonitorSchedule
fn clone(&self) -> MonitorSchedule
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MonitorSchedule
impl Debug for MonitorSchedule
Source§impl<'de> Deserialize<'de> for MonitorSchedule
impl<'de> Deserialize<'de> for MonitorSchedule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for MonitorSchedule
impl PartialEq for MonitorSchedule
Source§impl Serialize for MonitorSchedule
impl Serialize for MonitorSchedule
impl StructuralPartialEq for MonitorSchedule
Auto Trait Implementations§
impl Freeze for MonitorSchedule
impl RefUnwindSafe for MonitorSchedule
impl Send for MonitorSchedule
impl Sync for MonitorSchedule
impl Unpin for MonitorSchedule
impl UnwindSafe for MonitorSchedule
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