pub struct WorkingSet { /* private fields */ }Expand description
Working set - weakly-typed KV data container for inter-step communication
Implementations§
Source§impl WorkingSet
impl WorkingSet
Sourcepub fn new() -> WorkingSet
pub fn new() -> WorkingSet
Create a new empty working set
Sourcepub fn with_max_entries(max_entries: usize) -> WorkingSet
pub fn with_max_entries(max_entries: usize) -> WorkingSet
Create a working set with a hard entry limit.
Sourcepub fn set(&mut self, scope: Scope, key: impl Into<String>, value: Value)
pub fn set(&mut self, scope: Scope, key: impl Into<String>, value: Value)
Set a value by scope and key
Sourcepub fn remove(&mut self, scope: &Scope, key: &str) -> Option<Value>
pub fn remove(&mut self, scope: &Scope, key: &str) -> Option<Value>
Remove a value by scope and key
Sourcepub fn clear_scope(&mut self, scope: &Scope)
pub fn clear_scope(&mut self, scope: &Scope)
Clear all data in a specific scope
Sourcepub fn clear_all_step_scopes(&mut self)
pub fn clear_all_step_scopes(&mut self)
Clear all step scopes
Sourcepub fn remove_task(&mut self, key: &str) -> Option<Value>
pub fn remove_task(&mut self, key: &str) -> Option<Value>
Remove a value from task scope
Sourcepub fn get_global(&self, key: &str) -> Option<&Value>
pub fn get_global(&self, key: &str) -> Option<&Value>
Get a value from global scope
Sourcepub fn set_global(&mut self, key: impl Into<String>, value: Value)
pub fn set_global(&mut self, key: impl Into<String>, value: Value)
Set a value in global scope
Sourcepub fn remove_global(&mut self, key: &str) -> Option<Value>
pub fn remove_global(&mut self, key: &str) -> Option<Value>
Remove a value from global scope
Sourcepub fn get_step(&self, step_id: &str, key: &str) -> Option<&Value>
pub fn get_step(&self, step_id: &str, key: &str) -> Option<&Value>
Get a value from a specific step scope
Sourcepub fn set_step(
&mut self,
step_id: impl Into<String>,
key: impl Into<String>,
value: Value,
)
pub fn set_step( &mut self, step_id: impl Into<String>, key: impl Into<String>, value: Value, )
Set a value in a specific step scope
Sourcepub fn clear_step(&mut self, step_id: &str)
pub fn clear_step(&mut self, step_id: &str)
Clear a specific step scope
Sourcepub fn keys_in_scope(&self, scope: &Scope) -> Vec<&str>
pub fn keys_in_scope(&self, scope: &Scope) -> Vec<&str>
Get all keys in a scope
Sourcepub fn export_task_data(&self) -> HashMap<String, Value>
pub fn export_task_data(&self) -> HashMap<String, Value>
Export all task-scope data as a HashMap
Sourcepub fn import_task_data(&mut self, data: HashMap<String, Value>)
pub fn import_task_data(&mut self, data: HashMap<String, Value>)
Import data into task scope
Trait Implementations§
Source§impl Clone for WorkingSet
impl Clone for WorkingSet
Source§fn clone(&self) -> WorkingSet
fn clone(&self) -> WorkingSet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WorkingSet
impl Debug for WorkingSet
Source§impl Default for WorkingSet
impl Default for WorkingSet
Source§fn default() -> WorkingSet
fn default() -> WorkingSet
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for WorkingSet
impl<'de> Deserialize<'de> for WorkingSet
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<WorkingSet, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<WorkingSet, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for WorkingSet
impl Serialize for WorkingSet
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for WorkingSet
impl RefUnwindSafe for WorkingSet
impl Send for WorkingSet
impl Sync for WorkingSet
impl Unpin for WorkingSet
impl UnsafeUnpin for WorkingSet
impl UnwindSafe for WorkingSet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more