Module kvarn::extensions
source · Expand description
Here, all extensions code is housed.
Check out the page about extensions at kvarn.org for more info.
If you want to make new extensions for others to use, make sure to check other extensions,
so the priorities are valid. This can be done by using the debug implementation on Extensions
.
let extensions = Extensions::new();
println!("The currently mounted extensions: {:#?}", extensions);
Structs§
- Contains all extensions. See kvarn.org on extensions for more info.
- A extension Id. The
Self::priority
is used for sorting extensions andSelf::name
for debugging which extensions are mounted. - Add data pretending to present state in creating the response.
- A set of rules applicable to certain paths. See the note at
Self::empty
on how paths are matched.
Traits§
- Implement this to pass your extension to
Extensions::add_package
. - Implement this to pass your extension to
Extensions::add_post
. - Implement this to pass your extension to
Extensions::add_prepare_fn
orExtensions::add_prepare_single
. - Implement this to pass your extension to
Extensions::add_present_file
orExtensions::add_present_internal
orExtensions::add_present_fn
. - Implement this to pass your extension to
Extensions::add_prime
. - Implement this to pass your future to
FatResponse::with_future
.
Functions§
- Returns a future accepted by all the
extensions
yielding immediately withvalue
. - Prepare extension to stream body instead of: reading it fully, caching, then responding. Use with care!
Type Aliases§
- Dynamic function to check if a extension should be ran.
- A package extension.
- A post extension.
- A prepare extension.
- A present extension.
- A prime extension.
- A
Future
for writing to aResponsePipe
after the response is sent. - A return type for a
dyn
Future
.