pub struct VariableStateManager { /* private fields */ }
Expand description
Variable state manager for capabilities
Implementations§
Source§impl VariableStateManager
impl VariableStateManager
Sourcepub fn with_limits(max_variables: usize, max_name_length: usize) -> Self
pub fn with_limits(max_variables: usize, max_name_length: usize) -> Self
Create a new variable state manager with custom limits
Sourcepub async fn set_variable(
&self,
name: String,
value: Value,
) -> Result<bool, VariableError>
pub async fn set_variable( &self, name: String, value: Value, ) -> Result<bool, VariableError>
Set a variable value
Sourcepub async fn get_variable(&self, name: &str) -> Result<Value, VariableError>
pub async fn get_variable(&self, name: &str) -> Result<Value, VariableError>
Get a variable value
Sourcepub async fn has_variable(&self, name: &str) -> bool
pub async fn has_variable(&self, name: &str) -> bool
Check if a variable exists
Sourcepub async fn delete_variable(&self, name: &str) -> Result<bool, VariableError>
pub async fn delete_variable(&self, name: &str) -> Result<bool, VariableError>
Delete a variable
Sourcepub async fn clear_all_variables(&self) -> Result<bool, VariableError>
pub async fn clear_all_variables(&self) -> Result<bool, VariableError>
Clear all variables
Sourcepub async fn get_variable_names(&self) -> Vec<String>
pub async fn get_variable_names(&self) -> Vec<String>
Get all variable names
Sourcepub async fn variable_count(&self) -> usize
pub async fn variable_count(&self) -> usize
Get variable count
Sourcepub async fn export_variables(&self) -> HashMap<String, Value>
pub async fn export_variables(&self) -> HashMap<String, Value>
Export all variables as a HashMap (for serialization/debugging)
Sourcepub async fn import_variables(
&self,
vars: HashMap<String, Value>,
) -> Result<(), VariableError>
pub async fn import_variables( &self, vars: HashMap<String, Value>, ) -> Result<(), VariableError>
Import variables from a HashMap (for deserialization/restoration)
Trait Implementations§
Source§impl Debug for VariableStateManager
impl Debug for VariableStateManager
Auto Trait Implementations§
impl Freeze for VariableStateManager
impl !RefUnwindSafe for VariableStateManager
impl Send for VariableStateManager
impl Sync for VariableStateManager
impl Unpin for VariableStateManager
impl !UnwindSafe for VariableStateManager
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