pub struct Destination {
pub name: String,
pub kind: Kind,
pub events: Vec<EventKind>,
pub department: Option<String>,
/* private fields */
}Expand description
One place events are sent.
Fields§
§name: StringThe label: KASL_WEBHOOK_TEAM_CHAT is team-chat.
kind: Kind§events: Vec<EventKind>What it hears.
department: Option<String>The one department it is about, when it is about one. A channel for the design team hears about the design team: the same boundary every screen draws around a manager (ADR 0009).
Implementations§
Source§impl Destination
impl Destination
Sourcepub fn parse(variable: &str, value: &str) -> Result<Self, String>
pub fn parse(variable: &str, value: &str) -> Result<Self, String>
Reads one destination from its variable.
variable is the full name, KASL_WEBHOOK_TEAM. Errors name the
variable and never repeat its value - the value is a credential, and
an error message ends up in a log.
Sourcepub fn shown_target(&self) -> String
pub fn shown_target(&self) -> String
Where it goes, in words safe to show: the host of a hook, the chat of a bot. Enough to tell two destinations apart and to notice one pointed at the wrong place, and never enough to post through it.
Sourcepub fn redact(&self, text: &str) -> String
pub fn redact(&self, text: &str) -> String
Removes the credential from a piece of text before it is kept.
The dispatcher strips URLs from its errors already; this is the second lock, for the text nobody predicted - a proxy that echoes the request line, a library that changes what its errors say.
Trait Implementations§
Source§impl Clone for Destination
impl Clone for Destination
Source§impl Debug for Destination
impl Debug for Destination
impl Eq for Destination
Source§impl PartialEq for Destination
impl PartialEq for Destination
impl StructuralPartialEq for Destination
Auto Trait Implementations§
impl Freeze for Destination
impl RefUnwindSafe for Destination
impl Send for Destination
impl Sync for Destination
impl Unpin for Destination
impl UnsafeUnpin for Destination
impl UnwindSafe for Destination
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
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
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more