pachy-core 0.1.0

Core traits and types for the Pachycephalosaurus web framework
Documentation

pachy-core

Core traits and types for the Pachycephalosaurus web framework.

Features

  • Component trait for SSR rendering
  • RenderContext for request-aware rendering
  • RenderedNode for type-safe HTML construction
  • PachyResult error handling
  • inventory-based compile-time route registration

Usage

use pachy_core::{Component, RenderContext, RenderedNode, Result as PachyResult};

pub struct MyPage;

impl Component for MyPage {
    fn render(&self, ctx: &RenderContext) -> PachyResult<RenderedNode> {
        Ok(RenderedNode::new("<h1>Hello</h1>".to_string()))
    }
}