Skip to main content

DefaultTemplateProvider

Struct DefaultTemplateProvider 

Source
pub struct DefaultTemplateProvider { /* private fields */ }
Expand description

Default template provider using embedded templates with optional file overrides.

Implementations§

Source§

impl DefaultTemplateProvider

Source

pub fn new() -> Self

Create a new provider with embedded templates only.

Source

pub fn with_templates( template_data: TemplateData, strategy: MergeStrategy, ) -> Self

Create a provider with file-based templates.

Source

pub fn from_file(path: &Path) -> Result<Self, TemplateError>

Load templates from a file path.

Source

pub fn from_directory(path: &Path) -> Result<Self, TemplateError>

Load templates from a directory.

Source

pub fn with_merge_strategy(self, strategy: MergeStrategy) -> Self

Set the merge strategy.

Trait Implementations§

Source§

impl Default for DefaultTemplateProvider

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl TemplateProvider for DefaultTemplateProvider

Source§

fn get_person_first_name( &self, culture: NameCulture, is_male: bool, rng: &mut dyn RngCore, ) -> String

Get a random person first name for the given culture and gender.
Source§

fn get_person_last_name( &self, culture: NameCulture, rng: &mut dyn RngCore, ) -> String

Get a random person last name for the given culture.
Source§

fn get_vendor_name(&self, category: &str, rng: &mut dyn RngCore) -> String

Get a random vendor name for the given category.
Source§

fn get_customer_name(&self, industry: &str, rng: &mut dyn RngCore) -> String

Get a random customer name for the given industry.
Source§

fn get_material_description( &self, material_type: &str, rng: &mut dyn RngCore, ) -> String

Get a random material description for the given type.
Source§

fn get_asset_description(&self, category: &str, rng: &mut dyn RngCore) -> String

Get a random asset description for the given category.
Source§

fn get_line_text( &self, process: BusinessProcess, account_type: &str, rng: &mut dyn RngCore, ) -> String

Get a random line text for the given process and account type.
Source§

fn get_header_template( &self, process: BusinessProcess, rng: &mut dyn RngCore, ) -> String

Get a random header text template for the given process.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V