pub struct TemplateRenderer { /* private fields */ }Expand description
Template renderer with Tera engine
Provides template rendering with custom functions for:
- Environment variable access
- Deterministic timestamps
- SHA-256 hashing
- TOML encoding
- Macro library for common TOML patterns
Implementations§
Source§impl TemplateRenderer
impl TemplateRenderer
Sourcepub fn new() -> Result<Self>
pub fn new() -> Result<Self>
Create new template renderer with custom functions and macro library
Sourcepub fn with_defaults() -> Result<Self>
pub fn with_defaults() -> Result<Self>
Create renderer with default PRD v1.0 variable resolution
Initializes context with standard variables resolved via precedence: template vars → ENV → defaults
Sourcepub fn with_context(self, context: TemplateContext) -> Self
pub fn with_context(self, context: TemplateContext) -> Self
Set template context variables
Sourcepub fn merge_user_vars(&mut self, user_vars: HashMap<String, Value>)
pub fn merge_user_vars(&mut self, user_vars: HashMap<String, Value>)
Merge user-provided variables into context (respects precedence)
User variables take highest priority in the precedence chain
Sourcepub fn render_file(&mut self, path: &Path) -> Result<String>
pub fn render_file(&mut self, path: &Path) -> Result<String>
Render template file to TOML string
Auto Trait Implementations§
impl Freeze for TemplateRenderer
impl !RefUnwindSafe for TemplateRenderer
impl Send for TemplateRenderer
impl Sync for TemplateRenderer
impl Unpin for TemplateRenderer
impl !UnwindSafe for TemplateRenderer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request