Struct mo::config::GeneratorConfig [−][src]
Struct for define the config of the generator
Fields
expand_limit: Option<u32>
Max rules opened in generation, when this limit is reached the generation of subsequent rules return the parameter text_expand_limit.
default value: None (No limit)
soft_limit: usize
To process a rule the elements are placed in a stack. If the grammar is very deep or recursive the number of elements in the stack will be large, if the length of the stack exceeds the value of this parameter then the delimiters “*”, “+” will be converted into ranges [0,1] and [1,2] respectively in order to reduce the number of items to process.
default value: 10.000
hard_limit: usize
In the process of generating an example, each processed expression increases the expression counter, if the parameter value is reached, all the unprocessed expressions from now on will not produce any results, the identifiers will only return the parameter text_expand_limit.
default value: 25.000
limit_depth_level: usize
Limite máximo de recursividad, usado para evitar la excepción StackOverflow
All of the generation process of an example happens in a stack (There isn’t recursion involved) except for
a little expression !b ~ a
.
If you have a recursive grammar with a lot of negations, the parameter limit_depth_level return
the parameter text_expand_limit.
default value: 200
text_expand_limit: String
factor de convergencia alternativo (no usado actualmente) It’s the text returned by rules when the hard_limit or limit_depth_level is reached
benchmark_mode: bool
This parameter is just for avoid print elements or create a vec with them, because we only want to benchmark the generation
upper_bound_zero_or_more_repetition: u32
Limit the elements generated in a (“example”)* case e.g 1, will be a probability of 0.5 of not generating nothing (0/1) e.g 2, will be a probability of 0.33 of not generating nothing (0/1/2) e.g 3, will be a probability of 0.25 of not generating nothing (0/1/2/3)
upper_bound_one_or_more_repetition: u32
Limit the elements generated in a (“example”)+ case e.g 2, will generate maximum 2 “example” strings e.g 3, will generate maximum 3 “example” strings
upper_bound_at_least_repetition: u32
Upper limit present in “at least” expression e{n,} e.g 15, will generate between {n, n+15} “example” strings e.g 20, will generate between {n, n+20} “example” strings
max_attempts_negation: u32
When generator finds an expression !A ~ B It has to generate B and then probe that is not A here you can limit the times that B is generated and compared with A for more details please refer to README
Implementations
impl GeneratorConfig
[src]
pub fn new(config_file: &str) -> Result<Self, ConfigError>
[src]
Create a config with the provided TOML file
GeneratorConfig::new("config.toml")
If you want to get default config
let default: GeneratorConfig = Default::default();
pub fn benchmark() -> Self
[src]
Create a config for benchmark, It’s just change the parameter benchmark_mode
GeneratorConfig::benchmark()
If you want to get default config
let default: GeneratorConfig = Default::default();
Trait Implementations
impl Clone for GeneratorConfig
[src]
fn clone(&self) -> GeneratorConfig
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for GeneratorConfig
[src]
impl Default for GeneratorConfig
[src]
impl<'de> Deserialize<'de> for GeneratorConfig
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for GeneratorConfig
[src]
Auto Trait Implementations
impl RefUnwindSafe for GeneratorConfig
impl Send for GeneratorConfig
impl Sync for GeneratorConfig
impl Unpin for GeneratorConfig
impl UnwindSafe for GeneratorConfig
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,