pub struct CommandProcessor {
config: String,
commands_executed: Vec<String>,
dry_run: bool,
}Expand description
Processes Senzing command scripts (.gtc files)
Fields§
§config: String§commands_executed: Vec<String>§dry_run: boolImplementations§
Source§impl CommandProcessor
impl CommandProcessor
Sourcepub fn new(config_json: String) -> Self
pub fn new(config_json: String) -> Self
Create a new processor with initial configuration
§Arguments
config_json- Initial configuration JSON string
Sourcepub fn dry_run(self, enabled: bool) -> Self
pub fn dry_run(self, enabled: bool) -> Self
Enable or disable dry-run mode
In dry-run mode, commands are validated but not applied to the config.
§Arguments
enabled- true to enable dry-run mode
Sourcepub fn process_script(&mut self, script: &str) -> Result<String>
pub fn process_script(&mut self, script: &str) -> Result<String>
Sourcefn process_command(&mut self, line: &str) -> Result<()>
fn process_command(&mut self, line: &str) -> Result<()>
Process a single command line
Sourcepub fn get_executed_commands(&self) -> &[String]
pub fn get_executed_commands(&self) -> &[String]
Get list of executed commands
Sourcepub fn get_config(&self) -> &str
pub fn get_config(&self) -> &str
Get current configuration
Auto Trait Implementations§
impl Freeze for CommandProcessor
impl RefUnwindSafe for CommandProcessor
impl Send for CommandProcessor
impl Sync for CommandProcessor
impl Unpin for CommandProcessor
impl UnsafeUnpin for CommandProcessor
impl UnwindSafe for CommandProcessor
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