Skip to main content

Crate serenade_view

Crate serenade_view 

Source
Expand description

HTML view helpers: reverse routing, assets, partials, and document composition.

Escape stays in serenade_form; this crate re-exports it for one import surface. Document composition is engine-neutral; template engines can integrate without becoming mandatory dependencies of this crate. The optional leptos-ssr feature renders complete documents under a request-scoped Leptos owner and injects managed metadata. The leptos-client feature exposes the head root and lifecycle components used by CSR/hydrated apps. Compatible AOT compilers can target these components without becoming dependencies of this crate.

Structs§

AssetConfig
Base path for application assets (default /assets).
DefaultDocumentTemplate
The framework’s default document template.
Document
Application-provided head and body ready for document composition.
DocumentAssets
Build-generated markup delivered with every rendered document.
DocumentParts
Head and body inputs supplied to a document template.
RenderedDocument
A complete HTML document ready for HTTP or static-file delivery.
StaticDocumentWriter
Writes complete documents to route-derived index.html files.
TrunkAssetManifest
Assets produced by Trunk for one frontend build.
TrunkAssetReference
One external asset emitted by Trunk.
TrunkDocumentAsset
Markup generated by one Trunk asset pipeline, as written to Trunk’s HTML.
TrunkPreloadReference
One preload generated for a Rust/WASM bundle.
TrunkWasmBundle
Rust/WASM runtime bundle and initialization information.
ViewError
Error from view helpers such as crate::asset.

Constants§

STATIC_OUTPUT_DIR_ENV
Environment variable set by serenade-ssg for the static output directory.
TRUNK_ASSET_MANIFEST_ENV
Environment variable set by Serenade mode commands with the manifest path.
TRUNK_ASSET_MANIFEST_FILE
Filename emitted by Trunk for its build asset manifest.
TRUNK_DIST_DIRECTORY_ENV
Environment variable set by serenade-universal with the frontend output directory.

Traits§

DocumentTemplate
A template engine’s document-level composition boundary.

Functions§

asset
Builds an asset URL under the default /assets base.
escape_attr
Escapes a value for use inside a double-quoted HTML attribute.
escape_html
Escapes text for HTML body content (&, <, >, ", ').
partial
Runs body and returns its HTML fragment (named nesting for builders).
path
Builds a path for the named route (Twig path() analogue).
version
Compile-time crate version for diagnostics.