pub struct ResumaApp { /* private fields */ }Expand description
HTTP application builder for single-page and manual-route apps.
Register routes with page or page_with_request
(the latter receives FlowRequest — query, headers, method). Mount the axum router with
serve.
Built-in endpoints include /_resuma/loader.js, /_resuma/handler/:chunk.js, and
POST /_resuma/action/:name for #[server] actions.
Implementations§
Source§impl ResumaApp
impl ResumaApp
pub fn new() -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_site_url(self, url: impl Into<String>) -> Self
pub fn with_og_image(self, image: impl Into<String>) -> Self
pub fn with_json_ld(self, json_ld: impl Into<String>) -> Self
Sourcepub fn with_seo_kit(self, kit: SeoKit) -> Self
pub fn with_seo_kit(self, kit: SeoKit) -> Self
SEO / GEO / analytics kit (Meta Pixel, JSON-LD, llms.txt helpers).
pub fn with_pwa(self, pwa: PwaOptions) -> Self
pub fn with_stylesheet(self, href: impl Into<String>) -> Self
Sourcepub fn with_head(self, head: impl Into<String>) -> Self
pub fn with_head(self, head: impl Into<String>) -> Self
Append raw markup to the document <head>. Useful for embedding
inline <style> blocks during development.
Sourcepub fn with_streaming(self, enabled: bool) -> Self
pub fn with_streaming(self, enabled: bool) -> Self
Enable chunked streaming SSR (lower TTFB — head sent before body).
Sourcepub fn page_with_request<F>(self, path: &str, factory: F) -> Self
pub fn page_with_request<F>(self, path: &str, factory: F) -> Self
Register a page route with per-request HTTP context (query, headers, method).
Prefer this over page when the handler reads FlowRequest fields.
Sourcepub fn page<F>(self, path: &str, factory: F) -> Self
pub fn page<F>(self, path: &str, factory: F) -> Self
Register a page route without HTTP context (legacy / simple apps).
Sourcepub fn component<C>(self, path: &str, _component: C) -> Self
pub fn component<C>(self, path: &str, _component: C) -> Self
Register a no-props component route without spelling
Component::render(ComponentProps::default()).
ResumaApp::new().component("/", App)Sourcepub fn fallback_with_request<F>(self, factory: F) -> Self
pub fn fallback_with_request<F>(self, factory: F) -> Self
Catch-all renderer for dynamic routes (Resuma Flow param patterns).
Sourcepub fn handler_chunk(self, chunk_id: &str, source: impl Into<String>) -> Self
pub fn handler_chunk(self, chunk_id: &str, source: impl Into<String>) -> Self
Register a precompiled handler chunk to be served at
/_resuma/handler/<chunk>.js.
Sourcepub fn island_chunk(self, chunk_id: &str, source: impl Into<String>) -> Self
pub fn island_chunk(self, chunk_id: &str, source: impl Into<String>) -> Self
Register a precompiled island chunk to be served at
/_resuma/island-chunk/<chunk>.js.