Some checks failed
CI / Check typos (push) Failing after 9s
CI / Check links (push) Failing after 14s
CI / Clippy (push) Successful in 53s
CI / Build and test (push) Successful in 1m19s
CI / Build container (push) Has been skipped
CI / Deploy on waypoint (push) Has been skipped
27 lines
632 B
Rust
27 lines
632 B
Rust
mod asset;
|
|
pub use asset::*;
|
|
|
|
mod page;
|
|
pub use page::*;
|
|
|
|
mod redirect;
|
|
pub use redirect::*;
|
|
|
|
/// Something that may be served over http.
|
|
pub trait Servable: Send + Sync {
|
|
/// Return the same response as [Servable::render], but with an empty body.
|
|
/// Used to respond to `HEAD` requests.
|
|
fn head<'a>(
|
|
&'a self,
|
|
ctx: &'a crate::RenderContext,
|
|
) -> std::pin::Pin<Box<dyn Future<Output = crate::Rendered<()>> + 'a + Send + Sync>>;
|
|
|
|
/// Render this page
|
|
fn render<'a>(
|
|
&'a self,
|
|
ctx: &'a crate::RenderContext,
|
|
) -> std::pin::Pin<
|
|
Box<dyn Future<Output = crate::Rendered<crate::RenderedBody>> + 'a + Send + Sync>,
|
|
>;
|
|
}
|