pub enum ChannelTarget {
Email {
to: String,
},
Slack {
url: Url,
},
Discord {
url: Url,
},
Webhook {
url: Url,
secret: String,
},
}Expand description
Where a channel delivers to. Slack and Discord URLs carry a token, and a webhook has a secret,
so Debug shows hosts only.
Variants§
Implementations§
Source§impl ChannelTarget
impl ChannelTarget
pub fn kind(&self) -> ChannelKind
Sourcepub fn display(&self) -> String
pub fn display(&self) -> String
What may be shown on screen: the address for email, only the host for URLs (the path of a Slack or Discord URL is its secret), never a secret.
Sourcepub fn to_json(&self) -> Value
pub fn to_json(&self) -> Value
The JSON that is encrypted at rest: {to}, {url} or {url, secret}.
Sourcepub fn from_json(
kind: ChannelKind,
value: &Value,
) -> Result<ChannelTarget, TargetError>
pub fn from_json( kind: ChannelKind, value: &Value, ) -> Result<ChannelTarget, TargetError>
Reverses ChannelTarget::to_json.
Trait Implementations§
Source§impl Clone for ChannelTarget
impl Clone for ChannelTarget
Source§impl Debug for ChannelTarget
impl Debug for ChannelTarget
impl Eq for ChannelTarget
Source§impl PartialEq for ChannelTarget
impl PartialEq for ChannelTarget
impl StructuralPartialEq for ChannelTarget
Auto Trait Implementations§
impl Freeze for ChannelTarget
impl RefUnwindSafe for ChannelTarget
impl Send for ChannelTarget
impl Sync for ChannelTarget
impl Unpin for ChannelTarget
impl UnsafeUnpin for ChannelTarget
impl UnwindSafe for ChannelTarget
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.