Skip to main content

ResumaApp

Struct ResumaApp 

Source
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

Source

pub fn new() -> Self

Source

pub fn with_title(self, title: impl Into<String>) -> Self

Source

pub fn with_description(self, description: impl Into<String>) -> Self

Source

pub fn with_site_url(self, url: impl Into<String>) -> Self

Source

pub fn with_og_image(self, image: impl Into<String>) -> Self

Source

pub fn with_json_ld(self, json_ld: impl Into<String>) -> Self

Source

pub fn with_seo_kit(self, kit: SeoKit) -> Self

SEO / GEO / analytics kit (Meta Pixel, JSON-LD, llms.txt helpers).

Source

pub fn with_pwa(self, pwa: PwaOptions) -> Self

Source

pub fn with_stylesheet(self, href: impl Into<String>) -> Self

Source

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.

Source

pub fn with_streaming(self, enabled: bool) -> Self

Enable chunked streaming SSR (lower TTFB — head sent before body).

Source

pub fn page_with_request<F>(self, path: &str, factory: F) -> Self
where F: Fn(FlowRequest) -> View + Send + Sync + 'static,

Register a page route with per-request HTTP context (query, headers, method).

Prefer this over page when the handler reads FlowRequest fields.

Source

pub fn page<F>(self, path: &str, factory: F) -> Self
where F: Fn() -> View + Send + Sync + 'static,

Register a page route without HTTP context (legacy / simple apps).

Source

pub fn component<C>(self, path: &str, _component: C) -> Self
where C: Component + 'static, C::Props: Default,

Register a no-props component route without spelling Component::render(ComponentProps::default()).

ResumaApp::new().component("/", App)
Source

pub fn fallback_with_request<F>(self, factory: F) -> Self
where F: Fn(&str, FlowRequest) -> Option<View> + Send + Sync + 'static,

Catch-all renderer for dynamic routes (Resuma Flow param patterns).

Source

pub fn fallback<F>(self, factory: F) -> Self
where F: Fn(&str) -> Option<View> + Send + Sync + 'static,

Catch-all without HTTP context.

Source

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.

Source

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.

Source

pub async fn serve(self, opts: ServeOptions) -> Result<()>

Source

pub fn into_router(self) -> Router

Trait Implementations§

Source§

impl Default for ResumaApp

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more