pub struct Processor<'processor> { /* private fields */ }Expand description
Processor that parses(lexes) given input and print out to desginated output
Implementations
Clear custom macros
Set write option to yield output to the file
Write to variable
Yield error to the file
Yield error to the file
Custom comment character
Custom macro character
Use unix line ending instead of operating system’s default one
Set truncate option
👎 Deprecated since 1.2: Comment is deprecated and will be removed in 2.0 version.
Comment is deprecated and will be removed in 2.0 version.
Use comment
This is deprecated and will be removed in 2.0 version. Use set_comment_type instead.
Set comment type
Melt rule file
Melt rule as literal input source
👎 Deprecated since 1.5: Use “rule_files” instead.This method will be removed in 2.0
Use “rule_files” instead.This method will be removed in 2.0
Add custom rules
Open authority of processor but yield warning
👎 Deprecated since 1.3: Build method is deprecated in favor of more ergonomic builder pattern. It will be removed in 2.0
Build method is deprecated in favor of more ergonomic builder pattern. It will be removed in 2.0
Creates an unreferenced instance of processor
Print current permission status
Print the result of a processing
Freeze to a single file
Frozen file is a bincode encoded binary format file.
Add new closure rule
Accessing index bigger or equal to the length of argument vector is panicking error while “insufficient arguments” will simply prints error without panicking and stop evaluation.
Args
name- Name of the macro to addarg_count- Count of macro’s argumentclosure- Vector of string is an parsed arguments with given length.
Example
processor.add_closure_rule(
"test",
2,
Box::new(|args: Vec<String>| -> Option<String> {
Some(format!("First : {}\nSecond: {}", args[0], args[1]))
})
);Remove rules from map
Remove rules from map but only custom macro
Read from string
Read from standard input
If debug mode is enabled this, doesn’t read stdin line by line but by chunk because user input is also a standard input and processor cannot distinguish the two