pub struct TemplateGenerator { /* private fields */ }Expand description
Template-based synthetic data generator.
Generates variations by filling slots in templates.
Implementations§
Source§impl TemplateGenerator
impl TemplateGenerator
Sourcepub fn with_config(config: TemplateConfig) -> Self
pub fn with_config(config: TemplateConfig) -> Self
Create a generator with configuration.
Sourcepub fn add_template(&mut self, template: Template)
pub fn add_template(&mut self, template: Template)
Add a template.
Sourcepub fn with_template(self, template: Template) -> Self
pub fn with_template(self, template: Template) -> Self
Add a template (builder pattern).
Sourcepub fn config(&self) -> &TemplateConfig
pub fn config(&self) -> &TemplateConfig
Get configuration.
Sourcepub fn total_combinations(&self) -> usize
pub fn total_combinations(&self) -> usize
Calculate total possible combinations across all templates.
Sourcepub fn generate_samples(&self, count: usize, seed: u64) -> Vec<String>
pub fn generate_samples(&self, count: usize, seed: u64) -> Vec<String>
Generate samples from templates.
Sourcepub fn shell_commands() -> Self
pub fn shell_commands() -> Self
Create common shell command templates.
Trait Implementations§
Source§impl Clone for TemplateGenerator
impl Clone for TemplateGenerator
Source§fn clone(&self) -> TemplateGenerator
fn clone(&self) -> TemplateGenerator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TemplateGenerator
impl Debug for TemplateGenerator
Source§impl Default for TemplateGenerator
impl Default for TemplateGenerator
Source§impl SyntheticGenerator for TemplateGenerator
impl SyntheticGenerator for TemplateGenerator
Auto Trait Implementations§
impl Freeze for TemplateGenerator
impl RefUnwindSafe for TemplateGenerator
impl Send for TemplateGenerator
impl Sync for TemplateGenerator
impl Unpin for TemplateGenerator
impl UnwindSafe for TemplateGenerator
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more