Struct commodore::Mux
[−]
[src]
pub struct Mux { /* fields omitted */ }
A command de-multiplexor
Methods
impl Mux
[src]
fn new() -> Mux
fn command<C, T, H>(&mut self, cmd: C, token: T, handler: H) where
C: Into<String>,
T: Into<String>,
H: Handler + 'static,
C: Into<String>,
T: Into<String>,
H: Handler + 'static,
Install routing for a Slack command, secret token, and target Handler
fn matching<M, H>(&mut self, matcher: M, handler: H) where
M: Matcher + 'static,
H: Handler + 'static,
M: Matcher + 'static,
H: Handler + 'static,
Install routing for a Slack command matcher and target Handler
fn route(&mut self, route: Route)
Install a command routing
fn handler<'a>(
&self,
cmd: &'a Command
) -> Option<(Option<Captures<'a>>, &Box<Handler>)>
&self,
cmd: &'a Command
) -> Option<(Option<Captures<'a>>, &Box<Handler>)>
Attempts to return the first match result for a target Handler
Trait Implementations
impl Default for Mux
[src]
impl Handler for Mux
[src]
fn handle(
&self,
cmd: &Command,
_: &Option<Captures>,
responder: Box<Responder>
) -> Option<Response>
&self,
cmd: &Command,
_: &Option<Captures>,
responder: Box<Responder>
) -> Option<Response>
handles Slack commands. Optional captures resulting from matching are provided along with an interface for deferred responses Read more
fn as_handler(&self) -> &Handler
provides a mean explicit coersion for disambiguating cases where a fn named handle
is already defined in another trait for which another impl exists for the same type Read more
impl HyperHandler for Mux
[src]
fn handle(&self, req: Request, res: HyperResponse)
Receives a Request
/Response
pair, and should perform some action on them. Read more
fn check_continue(&self, (&Method, &RequestUri, &Headers)) -> StatusCode
Called when a Request includes a Expect: 100-continue
header. Read more
fn on_connection_start(&self)
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)
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