pub struct TemplateEngine { /* private fields */ }Expand description
Template engine — parameterized, reusable workflow patterns.
Implementations§
Source§impl TemplateEngine
impl TemplateEngine
pub fn new() -> Self
Sourcepub fn register(&mut self, template: WorkflowTemplate) -> WorkflowResult<()>
pub fn register(&mut self, template: WorkflowTemplate) -> WorkflowResult<()>
Register a template.
Sourcepub fn create_template(
&mut self,
name: &str,
description: &str,
parameters: Vec<TemplateParameter>,
workflow_definition: Value,
tags: Vec<String>,
author: &str,
) -> WorkflowResult<String>
pub fn create_template( &mut self, name: &str, description: &str, parameters: Vec<TemplateParameter>, workflow_definition: Value, tags: Vec<String>, author: &str, ) -> WorkflowResult<String>
Create a template from a workflow definition.
Sourcepub fn instantiate(
&mut self,
template_id: &str,
params: &HashMap<String, Value>,
) -> WorkflowResult<Value>
pub fn instantiate( &mut self, template_id: &str, params: &HashMap<String, Value>, ) -> WorkflowResult<Value>
Instantiate a workflow from a template with parameters.
Sourcepub fn list_templates(&self) -> Vec<&WorkflowTemplate>
pub fn list_templates(&self) -> Vec<&WorkflowTemplate>
List available templates.
Sourcepub fn search_by_tag(&self, tag: &str) -> Vec<&WorkflowTemplate>
pub fn search_by_tag(&self, tag: &str) -> Vec<&WorkflowTemplate>
Search templates by tag.
Sourcepub fn get_template(
&self,
template_id: &str,
) -> WorkflowResult<&WorkflowTemplate>
pub fn get_template( &self, template_id: &str, ) -> WorkflowResult<&WorkflowTemplate>
Get a template by ID.
Share a template.
List shared workflows.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TemplateEngine
impl RefUnwindSafe for TemplateEngine
impl Send for TemplateEngine
impl Sync for TemplateEngine
impl Unpin for TemplateEngine
impl UnsafeUnpin for TemplateEngine
impl UnwindSafe for TemplateEngine
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