Module perseus::template[][src]

Expand description

Utilities to do with templating. This is where the bulk of designing apps lies.

Structs

Represents all the different states that can be generated for a single template, allowing amalgamation logic to be run with the knowledge of what did what (rather than blindly working on a vector).

This allows the specification of all the template templates in an app and how to render them. If no rendering logic is provided at all, the template will be prerendered at build-time with no state. All closures are stored on the heap to avoid hellish lifetime specification. All properties for templates are passed around as strings to avoid type maps and other horrible things, this only adds one extra deserialization call at build time.

Type Definitions

The type of functions that amalgamate build and request states.

The type of functions that get build paths.

The type of functions that get build state.

The type of functions that get request state.

The type of functions that check if a template sghould revalidate.

A generic error type that mandates a string error. This sidesteps horrible generics while maintaining DX.

A generic error type that mandates a string errorr and a statement of causation (client or server) for status code generation.

The type of functions that are given a state and render a page. If you’ve defined state for your page, it’s safe to .unwrap() the given Option.

A type alias for a HashMap of Templates.