pub struct Notify {
pub method: String,
pub message: String,
}Expand description
Configuration for the notify action (RFC 5436).
method is a URI such as "mailto:ops@example.com" or
"xmpp:user@host". Any string is accepted (construction never fails);
evaluation emits an
EvalWarning::UnknownNotifyMethod
when the URI scheme is not one of the recognized notification schemes.
Fields§
§method: StringNotification method URI (:method).
message: StringHuman-readable message body (:message); empty means unset.
Implementations§
Source§impl Notify
impl Notify
Sourcepub fn new(method: impl Into<String>, message: impl Into<String>) -> Self
pub fn new(method: impl Into<String>, message: impl Into<String>) -> Self
Create a notification action for the given method URI.
Sourcepub fn scheme(&self) -> Option<String>
pub fn scheme(&self) -> Option<String>
The URI scheme of method (lowercased), i.e. the
portion before the first :, or None when the method has no
scheme.
Sourcepub fn has_known_scheme(&self) -> bool
pub fn has_known_scheme(&self) -> bool
Whether the method URI uses a scheme in KNOWN_NOTIFY_SCHEMES.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Notify
impl<'de> Deserialize<'de> for Notify
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
impl Eq for Notify
impl StructuralPartialEq for Notify
Auto Trait Implementations§
impl Freeze for Notify
impl RefUnwindSafe for Notify
impl Send for Notify
impl Sync for Notify
impl Unpin for Notify
impl UnsafeUnpin for Notify
impl UnwindSafe for Notify
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