Module kvarn::extensions

source ·
Expand description

Here, all extensions code is housed.

Check out the page about extensions at 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);


Contains all extensions. See on extensions for more info.
A extension Id. The Self::priority is used for sorting extensions and Self::name for debugging which extensions are mounted.
A Request Body which is lazily read.
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.


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 or Extensions::add_prepare_single.
Implement this to pass your extension to Extensions::add_prime.
Implement this to pass your future to FatResponse::with_future.


Returns a future accepted by all the extensions yielding immediately with value.

Type Definitions

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 a ResponsePipe after the response is sent.
A return type for a dyn Future.
Same as RetFut but also implementing Sync.