Struct switchboard_utils::runner::TaskRunnerContext
source · pub struct TaskRunnerContext {
pub anchor_client: Arc<Client<Arc<Keypair>>>,
pub value: TaskOutput,
pub cache: HashMap<String, String>,
}
Expand description
The TaskRunnerContext is used to pass the current running execution to child tasks. This is useful for caching values between tasks and passing values between tasks.
Fields§
§anchor_client: Arc<Client<Arc<Keypair>>>
§value: TaskOutput
§cache: HashMap<String, String>
Implementations§
source§impl TaskRunnerContext
impl TaskRunnerContext
sourcepub fn set_value(&mut self, value: TaskOutput)
pub fn set_value(&mut self, value: TaskOutput)
Set the current running result.
sourcepub fn get_cached_value(&self, key: &str) -> Option<&String>
pub fn get_cached_value(&self, key: &str) -> Option<&String>
Get a cached value from the context.
sourcepub fn set_cached_value(&mut self, key: &str, value: &str)
pub fn set_cached_value(&mut self, key: &str, value: &str)
Set a cached value in the context.
pub fn as_f64(&self) -> Result<f64, SbError>
Trait Implementations§
source§impl Clone for TaskRunnerContext
impl Clone for TaskRunnerContext
source§fn clone(&self) -> TaskRunnerContext
fn clone(&self) -> TaskRunnerContext
Returns a copy 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 RefUnwindSafe for TaskRunnerContext
impl Send for TaskRunnerContext
impl Sync for TaskRunnerContext
impl Unpin for TaskRunnerContext
impl UnwindSafe for TaskRunnerContext
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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