Struct rad::processor::Processor[][src]

pub struct Processor { /* fields omitted */ }
Expand description

Processor that parses(lexes) given input and print out to desginated output

Implementations

Creates default processor with basic macros

Creates default processor without basic macros

Set write option to yield output to the file

Yield error to the file

Use unix line ending instead of operating system’s default one

Set greedy option

Set purge option

Set lenient

Use comment

Set silent option

Set nopanic

Set assertion mode

Add custom rules

Open authority of processor

Open authority of processor but yield warning

Discard output

Creates an unreferenced instance of processor

Print current permission status

Print the result of a processing

Freeze to single file

Frozen file is a bincode encoded binary format file.

Add new basic rules

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 add
  • arg_count - Count of macro’s argument
  • closure - 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]))
    })
);

Add custom rules without builder pattern

Args

The order of argument is “name, args, body”

Example
processor.add_custom_rules(vec![("macro_name","macro_arg1 macro_arg2","macro_body=$macro_arg1()")]);

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

Process contents from a file

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.