docs.rs failed to build hyperchad_app-0.3.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
HyperChad App
Application framework and builder for HyperChad applications with routing and rendering.
Overview
The HyperChad App package provides:
- App Builder: Fluent application configuration and setup
- Routing Integration: Built-in router and navigation support
- Renderer Abstraction: Support for multiple rendering backends
- Command Line Interface: CLI for generation, cleaning, and serving
- Action Handling: Interactive action processing and event handling
- Asset Management: Static asset routing and management
Features
Application Builder
- Fluent API: Chain configuration methods for easy setup
- Router Integration: Built-in routing with initial route support
- Window Configuration: Position, size, background, and metadata
- Runtime Management: Async runtime handling and configuration
- Event Handling: Action handlers and resize listeners
CLI Commands
- Serve: Start development server
- Generate: Build static assets and routes
- Clean: Clean generated assets
- Dynamic Routes: List available dynamic routes
Renderer Support
- Multiple Backends: Support for different rendering targets
- Generator Interface: Static site generation capabilities
- Cleaner Interface: Asset cleanup and management
- Render Runner: Application execution and lifecycle
Action System
- Action Handlers: Custom action processing
- Logic Integration: Conditional action handling
- Event Processing: User interaction event handling
- Resize Handling: Window resize event management
Installation
Add this to your Cargo.toml:
[]
= { = "../hyperchad/app" }
= { = "../hyperchad/template" }
# Or customize features (logic and assets are enabled by default)
= {
path = "../hyperchad/app",
= false,
= ["egui", "logic"]
}
= { = "../hyperchad/template" }
Usage
Basic Application Setup
use ;
use Router;
use ;
use container;
// Create router
let router = new
.with_route
.with_route;
// Build application
let app = new
.with_router
.with_initial_route
.with_title
.with_size
.with_background
.build_default?;
// Run application
app.run?;
Window Configuration
let app = new
.with_router
.with_position // Window position
.with_size // Window size
.with_background // Background color
.with_title
.with_description
.with_viewport
.build_default?;
Action Handling
Note: Action handling requires the logic feature (enabled by default).
use Value;
let app = new
.with_router
.with_action_handler
.with_on_resize
.build_default?;
Static Asset Routes
Note: Static asset routes require the assets feature (enabled by default).
use ;
use Bytes;
let app = new
.with_router
.with_static_asset_route
.with_static_asset_route
.build_default?;
CLI Usage
# Serve application in development mode
# Generate static assets
# Clean generated assets
# List dynamic routes
Runtime Management
use Handle;
// Use custom runtime handle
let runtime_handle = current;
let app = new
.with_router
.with_runtime_handle
.build_default?;
Error Handling
use ;
match new.build_default
App Structure
AppBuilder
- Router: Application routing configuration
- Initial Route: Starting route for the application
- Window Properties: Position, size, background, title, description
- Runtime: Async runtime configuration
- Event Handlers: Action and resize event handlers
- Assets: Static asset route configuration
App
- Renderer: Rendering backend implementation
- Router: Request routing and handling
- Runtime: Async runtime management
- Configuration: Window and application settings
CLI Commands
serve
Start development server.
gen
Generate static assets and pre-rendered routes for production deployment.
clean
Remove generated assets and clean build artifacts.
dynamic-routes
Display available dynamic routes for debugging and development.
Traits
Generator
Cleaner
Feature Flags
Default Features
The following features are enabled by default:
actix: Actix web server supportassets: Static asset managementegui-wgpu: Egui renderer with WGPU backendfltk: FLTK renderer supportformat: Code formatting supporthtml: HTML rendering supportjson: JSON content supportlambda: AWS Lambda supportlogic: Action logic and conditional handlingstatic-routes: Static route generationvanilla-js: Vanilla JavaScript renderer
Additional Features
egui,egui-glow,egui-v1,egui-v2: Egui renderer variantsactions,sse: Server-sent events and action supportweb-server,web-server-actix,web-server-simulator: Web server variantswayland,x11: Linux display server supportdebug: Debug modeprofiling-puffin,profiling-tracing,profiling-tracy: Profiling backendssyntax-highlighting: Code syntax highlightingunsafe: Unsafe optimizationsbenchmark: Benchmarking supportall-plugins: Enable all vanilla-js pluginsplugin-*: Individual vanilla-js plugins (actions, canvas, form, idiomorph, nav, routing, sse, tauri-event, uuid, etc.)
Dependencies
Core Dependencies
- hyperchad_router: Application routing system
- hyperchad_renderer: Rendering abstraction layer
- hyperchad_actions: Interactive action system
- switchy: Async runtime abstraction with Tokio support
- switchy_env: Environment variable utilities
- moosicbox_env_utils: MoosicBox environment utilities
- moosicbox_assert: Assertion utilities
Optional Renderer Dependencies
- hyperchad_renderer_egui: Egui rendering backend (optional)
- hyperchad_renderer_fltk: FLTK rendering backend (optional)
- hyperchad_renderer_html: HTML rendering backend (optional)
- hyperchad_renderer_vanilla_js: Vanilla JS rendering backend (optional)
Utility Dependencies
- async-trait: Async trait support
- clap: Command-line argument parsing
- flume: Multi-producer multi-consumer channels
- log: Logging facade
- serde_json: JSON serialization
- thiserror: Error derive macros
Integration
This package is designed for:
- Desktop Applications: Native desktop app development
- Web Applications: Browser-based applications
- Static Sites: Static site generation
- Development Tools: Development server and asset management
- Cross-Platform: Consistent API across different platforms