pub struct Processor<'processor> { /* private fields */ }Expand description
Processor that parses(lexes) given input and print out to desginated output
Implementations
sourceimpl<'processor> Processor<'processor>
impl<'processor> Processor<'processor>
sourcepub fn write_to_file(
self,
target_file: Option<impl AsRef<Path>>
) -> RadResult<Self>
pub fn write_to_file(
self,
target_file: Option<impl AsRef<Path>>
) -> RadResult<Self>
Set write option to yield output to the file
sourcepub fn write_to_variable(self, value: &'processor mut String) -> Self
pub fn write_to_variable(self, value: &'processor mut String) -> Self
Write to variable
sourcepub fn error_to_file(
self,
target_file: Option<impl AsRef<Path>>
) -> RadResult<Self>
pub fn error_to_file(
self,
target_file: Option<impl AsRef<Path>>
) -> RadResult<Self>
Yield error to the file
sourcepub fn error_to_variable(self, value: &'processor mut String) -> Self
pub fn error_to_variable(self, value: &'processor mut String) -> Self
Yield error to the file
sourcepub fn custom_comment_char(self, character: char) -> RadResult<Self>
pub fn custom_comment_char(self, character: char) -> RadResult<Self>
Custom comment character
sourcepub fn custom_macro_char(self, character: char) -> RadResult<Self>
pub fn custom_macro_char(self, character: char) -> RadResult<Self>
Custom macro character
sourcepub fn unix_new_line(self, use_unix_new_line: bool) -> Self
pub fn unix_new_line(self, use_unix_new_line: bool) -> Self
Use unix line ending instead of operating system’s default one
sourcepub fn pipe_truncate(self, truncate: bool) -> Self
pub fn pipe_truncate(self, truncate: bool) -> Self
Set truncate option
sourcepub fn set_comment_type(self, comment_type: CommentType) -> Self
pub fn set_comment_type(self, comment_type: CommentType) -> Self
Set comment type
sourcepub fn silent(self, silent_type: WarningType) -> Self
pub fn silent(self, silent_type: WarningType) -> Self
Set silent option
sourcepub fn rule_literal(self, literal: &Vec<u8>) -> RadResult<Self>
pub fn rule_literal(self, literal: &Vec<u8>) -> RadResult<Self>
Melt rule as literal input source, or say from byte array
sourcepub fn allow_with_warning(self, auth_types: Option<Vec<AuthType>>) -> Self
pub fn allow_with_warning(self, auth_types: Option<Vec<AuthType>>) -> Self
Open authority of processor but yield warning
sourcepub fn insert_queue(&mut self, item: &str)
pub fn insert_queue(&mut self, item: &str)
Set queue object
sourcepub fn toggle_hygiene(&mut self, toggle: bool)
pub fn toggle_hygiene(&mut self, toggle: bool)
Toggle hygiene
sourcepub fn set_write_option(&mut self, write_option: WriteOption<'processor>)
pub fn set_write_option(&mut self, write_option: WriteOption<'processor>)
Set write option in the process
sourcepub fn swap_write_option(
&mut self,
write_option: WriteOption<'processor>
) -> WriteOption<'_>
pub fn swap_write_option(
&mut self,
write_option: WriteOption<'processor>
) -> WriteOption<'_>
Swap write option
sourcepub fn reset_flow_control(&mut self)
pub fn reset_flow_control(&mut self)
Set write option in the process
sourcepub fn print_permission(&mut self) -> RadResult<()>
pub fn print_permission(&mut self) -> RadResult<()>
Print current permission status
sourcepub fn print_result(&mut self) -> RadResult<()>
pub fn print_result(&mut self) -> RadResult<()>
Print the result of a processing
sourcepub fn clear_cache(&mut self) -> Option<String>
pub fn clear_cache(&mut self) -> Option<String>
Clear empty and retur returned cache
sourcepub fn freeze_to_file(&self, path: impl AsRef<Path>) -> RadResult<()>
pub fn freeze_to_file(&self, path: impl AsRef<Path>) -> RadResult<()>
Freeze to a single file
Frozen file is a bincode encoded binary format file.
sourcepub fn add_ext_macro(&mut self, ext: ExtMacroBuilder)
pub fn add_ext_macro(&mut self, ext: ExtMacroBuilder)
Add a new macro as an extension
sourcepub fn add_runtime_rules(
&mut self,
rules: Vec<(impl AsRef<str>, &str, &str)>
) -> RadResult<()>
pub fn add_runtime_rules(
&mut self,
rules: Vec<(impl AsRef<str>, &str, &str)>
) -> RadResult<()>
sourcepub fn add_static_rules(
&mut self,
rules: Vec<(impl AsRef<str>, impl AsRef<str>)>
) -> RadResult<()>
pub fn add_static_rules(
&mut self,
rules: Vec<(impl AsRef<str>, impl AsRef<str>)>
) -> RadResult<()>
sourcepub fn from_stdin(&mut self) -> RadResult<Option<String>>
pub fn from_stdin(&mut self) -> RadResult<Option<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
sourcepub fn from_file(&mut self, path: impl AsRef<Path>) -> RadResult<Option<String>>
pub fn from_file(&mut self, path: impl AsRef<Path>) -> RadResult<Option<String>>
Process contents from a file
pub fn print_error(&mut self, error: &str) -> RadResult<()>
pub fn get_split_arguments(
&self,
target_length: usize,
source: &str
) -> RadResult<Vec<String>>
sourcepub fn check_auth(&mut self, auth_type: AuthType) -> RadResult<bool>
pub fn check_auth(&mut self, auth_type: AuthType) -> RadResult<bool>
Check auth information
This will print log_error if auth was enabled with warning
@return If auth is enabled or not
sourcepub fn expand(
&mut self,
level: usize,
source: impl AsRef<str>
) -> RadResult<String>
pub fn expand(
&mut self,
level: usize,
source: impl AsRef<str>
) -> RadResult<String>
Expand given text
sourcepub fn contains_macro(&self, macro_name: &str, macro_type: MacroType) -> bool
pub fn contains_macro(&self, macro_name: &str, macro_type: MacroType) -> bool
Check if given macro exists
sourcepub fn undefine_macro(&mut self, macro_name: &str, macro_type: MacroType)
pub fn undefine_macro(&mut self, macro_name: &str, macro_type: MacroType)
Try undefine macro
sourcepub fn rename_macro(
&mut self,
macro_name: &str,
target_name: &str,
macro_type: MacroType
)
pub fn rename_macro(
&mut self,
macro_name: &str,
target_name: &str,
macro_type: MacroType
)
Rename macro
sourcepub fn append_macro(&mut self, macro_name: &str, target: &str)
pub fn append_macro(&mut self, macro_name: &str, target: &str)
Append content into a macro
sourcepub fn replace_macro(&mut self, macro_name: &str, target: &str) -> bool
pub fn replace_macro(&mut self, macro_name: &str, target: &str) -> bool
Replace macro’s content
sourcepub fn add_new_local_macro(
&mut self,
level: usize,
macro_name: &str,
body: &str
)
pub fn add_new_local_macro(
&mut self,
level: usize,
macro_name: &str,
body: &str
)
Add new local macro
Auto Trait Implementations
impl<'processor> RefUnwindSafe for Processor<'processor>
impl<'processor> Send for Processor<'processor>
impl<'processor> Sync for Processor<'processor>
impl<'processor> Unpin for Processor<'processor>
impl<'processor> !UnwindSafe for Processor<'processor>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more