pub struct Webhooks { /* private fields */ }Expand description
Every destination this installation sends to, and where its screens live.
Implementations§
Source§impl Webhooks
impl Webhooks
Sourcepub fn from_vars(
vars: impl IntoIterator<Item = (String, String)>,
public_url: Option<String>,
) -> Result<Self, String>
pub fn from_vars( vars: impl IntoIterator<Item = (String, String)>, public_url: Option<String>, ) -> Result<Self, String>
Reads every KASL_WEBHOOK_* variable among vars.
An error in any one stops the server from starting, and names the variable without repeating its value.
Sourcepub fn new(destinations: Vec<Destination>, public_url: Option<&str>) -> Self
pub fn new(destinations: Vec<Destination>, public_url: Option<&str>) -> Self
A set built in code, for the tests.
pub fn destinations(&self) -> &[Destination]
pub fn get(&self, name: &str) -> Option<&Destination>
Sourcepub fn anyone_hears(&self, event: EventKind) -> bool
pub fn anyone_hears(&self, event: EventKind) -> bool
Whether any destination hears event - checked before assembling one,
so an installation with no webhooks pays nothing for them.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Webhooks
impl RefUnwindSafe for Webhooks
impl Send for Webhooks
impl Sync for Webhooks
impl Unpin for Webhooks
impl UnsafeUnpin for Webhooks
impl UnwindSafe for Webhooks
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,
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