pub struct WebhookNotifier { /* private fields */ }Implementations§
Source§impl WebhookNotifier
impl WebhookNotifier
Sourcepub fn from_config(
entry: &str,
cfg: &WebhookNotifyConfig,
env: &Environment<'static>,
outbound: Outbound,
) -> Result<Self>
pub fn from_config( entry: &str, cfg: &WebhookNotifyConfig, env: &Environment<'static>, outbound: Outbound, ) -> Result<Self>
Builds one entry’s notifier, refusing everything unusable here — an unparseable URL, an unknown verb, a header a wire format will not carry and a body template that does not compile are all configuration, so they stop the server rather than becoming a permanent delivery failure hours later, on the one event an operator was waiting for.
Trait Implementations§
Source§impl Debug for WebhookNotifier
impl Debug for WebhookNotifier
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
dyn Resolver is not Debug, and two of these fields are secrets: the
URL’s path carries the credential for a Slack hook or a Telegram bot,
and a header value carries it for Matrix. So the host, the method and
the header names are rendered, and nothing else. Mirrors
FilterPolicy’s own impl.
Source§impl NotifyBackend for WebhookNotifier
impl NotifyBackend for WebhookNotifier
Source§fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 NotifyEvent,
) -> Pin<Box<dyn Future<Output = Result<(), NotifyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send<'life0, 'life1, 'async_trait>(
&'life0 self,
event: &'life1 NotifyEvent,
) -> Pin<Box<dyn Future<Output = Result<(), NotifyError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Delivers
event. Failure is always non-fatal to the caller — see the
module docs — but it is no longer thrown away: NotifyJob retries it
unless the NotifyError says the attempt could never have worked.Auto Trait Implementations§
impl !RefUnwindSafe for WebhookNotifier
impl !UnwindSafe for WebhookNotifier
impl Freeze for WebhookNotifier
impl Send for WebhookNotifier
impl Sync for WebhookNotifier
impl Unpin for WebhookNotifier
impl UnsafeUnpin for WebhookNotifier
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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> ⓘ
Converts
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> ⓘ
Converts
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