[][src]Struct afterparty_ng::Hub

pub struct Hub { /* fields omitted */ }

A hub is a registry of hooks

Methods

impl Hub
[src]

pub fn new() -> Hub
[src]

construct a new hub instance

pub fn handle_authenticated<H, S>(&mut self, event: &str, secret: S, hook: H) where
    H: Hook + 'static,
    S: Into<String>, 
[src]

adds a new web hook which will only be applied when a delivery is revcieved with a valid request signature based on the provided secret

pub fn handle<H>(&mut self, event: &str, hook: H) where
    H: Hook + 'static, 
[src]

add a need hook to list of hooks interested in a given event

pub fn hooks(&self, event: &str) -> Option<Vec<&Box<dyn Hook>>>
[src]

get all interested hooks for a given event

Trait Implementations

impl Default for Hub
[src]

impl Handler for Hub
[src]

fn check_continue(&self, (&Method, &RequestUri, &Headers)) -> StatusCode
[src]

Called when a Request includes a Expect: 100-continue header. Read more

fn on_connection_start(&self)
[src]

This is run after a connection is received, on a per-connection basis (not a per-request basis, as a connection with keep-alive may handle multiple requests) Read more

fn on_connection_end(&self)
[src]

This is run before a connection is closed, on a per-connection basis (not a per-request basis, as a connection with keep-alive may handle multiple requests) Read more

Auto Trait Implementations

impl Send for Hub

impl Sync for Hub

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<F> Handler for F where
    F: Fn(Request, Response<Fresh>) + Sync + Send
[src]

fn check_continue(&self, (&Method, &RequestUri, &Headers)) -> StatusCode
[src]

Called when a Request includes a Expect: 100-continue header. Read more

fn on_connection_start(&self)
[src]

This is run after a connection is received, on a per-connection basis (not a per-request basis, as a connection with keep-alive may handle multiple requests) Read more

fn on_connection_end(&self)
[src]

This is run before a connection is closed, on a per-connection basis (not a per-request basis, as a connection with keep-alive may handle multiple requests) Read more