1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! Composing FastCGI requests
//!
//! You can view the handling of a FastCGI request as pipeline, or sequence of steps.
//! Each step may modify the `Response`.
//! Crucially, steps have the option of either forwarding their modified `Response` to the next step, or
//! "breaking off" with their response, thus preventing subsequent steps from being run.
//!
//! The `Pipe` trait encapsulates this behavior through.
//!
//! `Pipe`s get access to combinatorial methods that make it easy to create non-trivial request
//! pipelines.
//!
//! You are not limited to the pipes defined in this module though, as it is easy to implement
//! your own. See the [`Pipe`] trait docs for details.
use crateFcgiContext;
pub use FileServer;
pub use Router;
/// A trait for processing FastCGI requests in a composable way.
///
/// See the [module documentation](crate::pipe) for an introduction
///
/// # Implementing the trait
///
/// The logic that should be executed during a request should be placed in the `run()` method.
/// It takes a shared `&self` receiver because there will usually be one copy of the `Pipe` shared
/// among connection-handling threads.
///
/// By default, the next pipe configured pipe will run, unless the
/// [`FcgiContext::halt()`](crate::FcgiContext::halt) is called, which short-circuits the pipeline.
/// See [`Pipe::and`]