pub struct WebhookServiceBuilder { /* private fields */ }Expand description
Configures a WebhookService.
Implementations§
Source§impl WebhookServiceBuilder
impl WebhookServiceBuilder
Sourcepub fn allow_organizer(
self,
organizer: impl Into<String>,
) -> Result<Self, WebhookFilterError>
pub fn allow_organizer( self, organizer: impl Into<String>, ) -> Result<Self, WebhookFilterError>
Allows payloads from one organizer slug.
§Errors
Returns WebhookFilterError when organizer is empty or has leading
or trailing whitespace.
Sourcepub fn allow_event(
self,
event: impl Into<String>,
) -> Result<Self, WebhookFilterError>
pub fn allow_event( self, event: impl Into<String>, ) -> Result<Self, WebhookFilterError>
Allows payloads for one event slug, independently of organizer filters.
§Errors
Returns WebhookFilterError when event is empty or has leading or
trailing whitespace.
Sourcepub fn require_basic_auth(
self,
credentials: impl IntoIterator<Item = BasicAuthCredential>,
) -> Self
pub fn require_basic_auth( self, credentials: impl IntoIterator<Item = BasicAuthCredential>, ) -> Self
Requires any one of the supplied credentials.
Passing an empty iterator disables authentication.
Sourcepub fn body_limit(self, body_limit: usize) -> Self
pub fn body_limit(self, body_limit: usize) -> Self
Sets the maximum request body size in bytes.
The default is DEFAULT_BODY_LIMIT. A request that exceeds the limit
receives 413 Payload Too Large without reaching the handler.
Sourcepub fn build<H>(self, handler: H) -> WebhookService<H>
pub fn build<H>(self, handler: H) -> WebhookService<H>
Builds an HTTP webhook service around an event handler.
Trait Implementations§
Source§impl Clone for WebhookServiceBuilder
impl Clone for WebhookServiceBuilder
Source§fn clone(&self) -> WebhookServiceBuilder
fn clone(&self) -> WebhookServiceBuilder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WebhookServiceBuilder
Reports how much policy is configured without disclosing any of it.
impl Debug for WebhookServiceBuilder
Reports how much policy is configured without disclosing any of it.
Configured slugs are policy, not payload data, so they are redacted for the
same reason BasicAuthCredential and WebhookFilterError are: a
derived Debug would place them in any diagnostic that renders a
configuration.