pub struct NotifyDispatcher { /* private fields */ }Expand description
The configured notify backends for one profile.
Cheap to clone behind the Arc it is always held in (Profile::notify,
and the profile name -> dispatcher map handed to the relay signer
backend and to NotifyJob).
Implementations§
Source§impl NotifyDispatcher
impl NotifyDispatcher
Sourcepub fn new(
profile: impl Into<String>,
slots: Vec<BackendSlot>,
jobs: JobQueue,
) -> Self
pub fn new( profile: impl Into<String>, slots: Vec<BackendSlot>, jobs: JobQueue, ) -> Self
Builds a dispatcher over already-constructed slots.
Sourcepub fn disabled(jobs: JobQueue) -> Self
pub fn disabled(jobs: JobQueue) -> Self
A dispatcher with no backends — every dispatch is a no-op. The shape a
profile with an empty notify.enabled gets, and what tests that do not
care about notifications want.
Sourcepub fn profile(&self) -> &str
pub fn profile(&self) -> &str
The profile whose [notify] section this dispatcher was built from.
Sourcepub fn slot(&self, id: &str) -> Option<&BackendSlot>
pub fn slot(&self, id: &str) -> Option<&BackendSlot>
The backend registered under id, if it is still configured. None
after a configuration change removed a backend a queued job still names.
Sourcepub async fn dispatch(&self, event: NotifyEvent)
pub async fn dispatch(&self, event: NotifyEvent)
Queues one delivery per backend that wants this event, and returns.
Not ?-able and with nothing useful to return: a notification can never
affect the ACME response that triggered it, which is why this goes
through JobQueue::enqueue_or_log — a database failure here is logged
and swallowed exactly like the delivery failure it stands in for.
The delivery_id is minted per call, so the queue’s identity index never
refuses a genuine second occurrence of the same event: two dispatches
mean two notifications, as they always did. It is shared across the
backends of one call purely so an operator can correlate them in a log.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for NotifyDispatcher
impl !UnwindSafe for NotifyDispatcher
impl Freeze for NotifyDispatcher
impl Send for NotifyDispatcher
impl Sync for NotifyDispatcher
impl Unpin for NotifyDispatcher
impl UnsafeUnpin for NotifyDispatcher
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
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