pub struct ServerBuilder { /* private fields */ }
Expand description

ServerBuilder is used to first register closures to events before finally building a tide::Server using those closures.

Implementations

Registers the given event handler to be run when the given event is received.

The event handler receives a [Payload] as the single argument. Since webhooks are generally passively consumed (Github will not meaningfully (to us) process our response), the handler returns only a (). As far as the event dispatcher is concerned, all the meaningful work will be done as side-effects of the closures you register here.

The types involved here are not stable yet due to ongoing API development.

Example
    let github = tide_github::new("my webhook s3ct#t")
        .on(Event::IssueComment, |payload| {
            println!("Got payload for repository {}", payload.repository.name)
        });

Build a tide::Server using the registered events.

Since the API is still in development, in the future we might instead (or additionally) expose the EventHandlerDispatcher directly.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more