Enum MonitorSchedule
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§
§impl MonitorSchedule
impl MonitorSchedule
pub fn from_crontab(
crontab_str: &str,
) -> Result<MonitorSchedule, CrontabParseError>
pub fn from_crontab( crontab_str: &str, ) -> Result<MonitorSchedule, 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§
§impl Clone for MonitorSchedule
impl Clone for MonitorSchedule
§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 more§impl Debug for MonitorSchedule
impl Debug for MonitorSchedule
§impl<'de> Deserialize<'de> for MonitorSchedule
impl<'de> Deserialize<'de> for MonitorSchedule
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MonitorSchedule, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MonitorSchedule, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl PartialEq for MonitorSchedule
impl PartialEq for MonitorSchedule
§impl Serialize for MonitorSchedule
impl Serialize for MonitorSchedule
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)