Skip to main content

FlowApp

Struct FlowApp 

Source
pub struct FlowApp { /* private fields */ }
Expand description

Full-stack application: pages, layouts, server loads, form submits, and middleware.

Wraps ResumaApp. Call serve with FlowServeOptions::from_env on Fly.io, Docker, or local dev.

Implementations§

Source§

impl FlowApp

Source

pub fn new() -> Self

Source

pub fn static_asset( self, path: impl Into<String>, body: &'static [u8], content_type: &'static str, ) -> Self

Serve a fixed byte slice at path (must start with /).

Source

pub fn client_asset(self, id: impl AsRef<str>, body: &'static [u8]) -> Self

Register a TypeScript client component bundle at /static/client/{id}.js.

Source

pub fn with_extension( self, key: impl Into<String>, value: impl Serialize, ) -> Self

Attach a JSON-serializable value to every request (req.extension("key") in loads/submits).

Source

pub fn with_extensions(self, extensions: FlowExtensions) -> Self

Merge a map of extensions into every request (e.g. "db": "ready" marker after pool init).

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_pwa(self, config: FlowPwaConfig) -> Self

Enable installable PWA (manifest, service worker, icons) for Android/iOS/desktop.

Source

pub fn with_head(self, head: impl Into<String>) -> Self

Source

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

Source

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

Enable chunked streaming SSR (head sent before body completes).

Source

pub fn not_found<F>(self, handler: F) -> Self
where F: Fn() -> View + Send + Sync + 'static,

Custom 404 page renderer.

Source

pub fn auto_pages<R>(self, pages_root: impl AsRef<Path>, registry: R) -> Self
where R: FlowPageRegistry + 'static,

Register all pages under pages_root using a generated FlowPageRegistry.

Source

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

Source

pub fn page_with_layouts<F>( self, pattern: &str, layouts: Vec<String>, handler: F, ) -> Self
where F: Fn(FlowRequest) -> View + Send + Sync + 'static,

Source

pub fn pages_from_registry( self, pages_root: impl AsRef<Path>, registry: Arc<dyn FlowPageRegistry>, ) -> Self

Source

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

Source

pub fn into_router(self, opts: FlowServeOptions) -> Router

Build the axum router (pages, Flow routes, static assets, security layers).

Trait Implementations§

Source§

impl Default for FlowApp

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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
Source§

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