pachy-core 0.1.0

Core traits and types for the Pachycephalosaurus web framework
Documentation
pub mod component;
pub mod error;
pub mod props;

pub use component::{Component, RenderContext, RenderedNode};
pub use error::PachyError;
pub use props::Props;

pub type Result<T> = std::result::Result<T, PachyError>;

/// Compile-time route registration entry emitted by `#[page]`.
pub struct PageRegistration {
    /// The Rust module path of the page, e.g. `"my_app::routes::about::page"`.
    /// Used at startup to derive the HTTP route path.
    pub module_path: &'static str,
    /// Factory that constructs a boxed `Component` instance.
    pub factory: fn() -> Box<dyn Component>,
}

inventory::collect!(PageRegistration);