Module rusty_express::prelude

source ·

Re-exports

pub use HttpServer;
pub use ServerDef;

Modules

Structs

Enums

Traits

In order to streamline the way to supply rendering context information to the underlying template engines, the EngineContext trait is required to be implemented by the ViewEngine framework’s data model objects. However, the framework can choose other means to obtain context info, under which case, the display function can be no-op (i.e. always return empty string wrapped in Ok() as the return value)
SessionData is the trait that must be implemented for storing the session related information into the session store service provided by this module. The ‘serialize’ function is used to destruct the session object for persistent storage (currently only supporting plain text file); the ‘deserialize’ serves as the constructor based on the saved info from the saved info.

Type Definitions

Function type alias ViewEngine represents the function signature required for the external view engine framework to be used in the Rusty_Express. Each engine shall be specific to handle one type of html-template. The 1st parameter represents the raw template content in string format, while the 2nd parameter represents the rendering context – the information required to render the template into customisable webpage.