pub struct PersonaTemplateRegistry { /* private fields */ }Expand description
Template registry for managing domain-specific templates
Implementations§
Source§impl PersonaTemplateRegistry
impl PersonaTemplateRegistry
Sourcepub fn register_template(
&mut self,
domain: Domain,
template: Box<dyn PersonaTemplate + Send + Sync>,
)
pub fn register_template( &mut self, domain: Domain, template: Box<dyn PersonaTemplate + Send + Sync>, )
Register a template for a domain
Sourcepub fn get_template(
&self,
domain: Domain,
) -> Option<&(dyn PersonaTemplate + Send + Sync)>
pub fn get_template( &self, domain: Domain, ) -> Option<&(dyn PersonaTemplate + Send + Sync)>
Get a template for a domain
Sourcepub fn generate_traits_for_persona(
&self,
persona: &PersonaProfile,
) -> HashMap<String, String>
pub fn generate_traits_for_persona( &self, persona: &PersonaProfile, ) -> HashMap<String, String>
Generate traits for a persona using the appropriate template
Sourcepub fn apply_template_to_persona(
&self,
persona: &mut PersonaProfile,
) -> Result<()>
pub fn apply_template_to_persona( &self, persona: &mut PersonaProfile, ) -> Result<()>
Apply template traits to a persona
Generates traits using the template and adds them to the persona.
Sourcepub fn apply_template_to_persona_with_backstory(
&self,
persona: &mut PersonaProfile,
generate_backstory: bool,
) -> Result<()>
pub fn apply_template_to_persona_with_backstory( &self, persona: &mut PersonaProfile, generate_backstory: bool, ) -> Result<()>
Apply template traits and optionally generate a backstory
Generates traits using the template, adds them to the persona, and
optionally generates a backstory if generate_backstory is true.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PersonaTemplateRegistry
impl !RefUnwindSafe for PersonaTemplateRegistry
impl Send for PersonaTemplateRegistry
impl Sync for PersonaTemplateRegistry
impl Unpin for PersonaTemplateRegistry
impl !UnwindSafe for PersonaTemplateRegistry
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