Expand description
Template provider traits for systemprompt.io’s AI-governance template registry.
This crate is the config-as-code foundation for rendering pages, components,
and partials. It exposes a small set of traits — TemplateProvider,
TemplateLoader, TemplateDataExtender, ComponentRenderer,
PageDataProvider, and PagePrerenderer — together with two ready-made
loaders (EmbeddedLoader and, behind the tokio feature,
FileSystemLoader).
Concrete provider implementations live in systemprompt-templates;
consumers depend on this crate only when they need to plug in to that
pipeline (custom loaders, custom extenders, custom prerenderers).
§Feature flags
| Feature | Default | Adds |
|---|---|---|
tokio | no | FileSystemLoader, a tokio::fs-backed TemplateLoader with base-path sandboxing |
All public items are documented and docs.rs is built with
--all-features.
§Example
use std::sync::Arc;
use systemprompt_template_provider::{DynTemplateLoader, EmbeddedLoader};
let loader: DynTemplateLoader = Arc::new(EmbeddedLoader);Re-exports§
pub use traits::EmbeddedLoader;pub use traits::TemplateLoader;pub use traits::TemplateLoaderError;pub use traits::TemplateLoaderResult;pub use traits::FileSystemLoader;
Modules§
- traits
- Trait surface for the template provider pipeline.
Structs§
- Component
Context - Extended
Data - Extender
Context - Page
Context - Page
Prepare Context - Page
Render Spec - Partial
Template - Rendered
Component - Template
Definition