pub struct VariableManager { /* private fields */ }
Expand description
变量管理器
Implementations§
Source§impl VariableManager
impl VariableManager
Sourcepub fn replace_variables(&self, content: &str) -> String
pub fn replace_variables(&self, content: &str) -> String
替换字符串中的变量占位符
Sourcepub fn extract_variables(
&mut self,
extract_rules: &[ExtractRule],
execution_result: &ExecutionResult,
) -> Result<()>
pub fn extract_variables( &mut self, extract_rules: &[ExtractRule], execution_result: &ExecutionResult, ) -> Result<()>
从执行结果中提取变量
Sourcepub fn get_variables(&self) -> &HashMap<String, String>
pub fn get_variables(&self) -> &HashMap<String, String>
获取当前所有变量
Sourcepub fn remove_variable(&mut self, key: &str)
pub fn remove_variable(&mut self, key: &str)
移除变量
Sourcepub fn set_variable(&mut self, key: String, value: String)
pub fn set_variable(&mut self, key: String, value: String)
设置变量
Sourcepub fn get_variable(&self, key: &str) -> Option<&String>
pub fn get_variable(&self, key: &str) -> Option<&String>
获取变量值
Trait Implementations§
Source§impl Clone for VariableManager
impl Clone for VariableManager
Source§fn clone(&self) -> VariableManager
fn clone(&self) -> VariableManager
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for VariableManager
impl RefUnwindSafe for VariableManager
impl Send for VariableManager
impl Sync for VariableManager
impl Unpin for VariableManager
impl UnwindSafe for VariableManager
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