Skip to main content

reload

Function reload 

Source
pub fn reload() -> Result<(), String>
Available on crate feature tera only.
Expand description

Reload the global template engine’s templates from disk.

See the module-level hot reload section. Wired into crate::config_reload::reload automatically, so SIGHUP (or your own trigger calling config_reload::reload()) reloads templates too — you don’t need to call this directly unless you want reload on a different trigger.

§Errors

Returns Err if init hasn’t been called yet, or if TeraEngine::reload fails (in which case the previously-loaded templates are still active and still being served — see TeraEngine::reload’s docs on why a bad edit can’t corrupt the live template set).