pub struct Context {
pub runtime: Arc<Runtime>,
pub executor: Arc<Executor>,
pub proc: Arc<Process>,
/* private fields */
}Fields§
§runtime: Arc<Runtime>§executor: Arc<Executor>§proc: Arc<Process>Implementations§
Source§impl Context
impl Context
pub fn new(proc: &Arc<Process>, task: &Arc<Task>) -> Self
pub fn scope<T, F: Fn() -> T>(ctx: Context, f: F) -> T
pub fn with<T, F: Fn(&Context) -> T>(f: F) -> T
pub fn current() -> Result<Context>
pub fn set_task(&self, task: &Arc<Task>)
pub fn task(&self) -> Arc<Task> ⓘ
pub fn prepare(&self)
pub fn set_action(&self, action: &Action) -> Result<()>
pub fn vars(&self) -> Vars
pub fn set_env<T>(&self, name: &str, value: T)
pub fn get_env<T>(&self, name: &str) -> Option<T>where
T: for<'de> Deserialize<'de> + Clone,
pub fn set_var<T>(&self, name: &str, value: T)
pub fn get_var<T>(&self, name: &str) -> Option<T>where
T: for<'de> Deserialize<'de> + Clone,
pub fn eval<T: DeserializeOwned + Serialize>(&self, expr: &str) -> Result<T>
pub fn sched_task(&self, node: &Arc<Node>) -> Result<()>
pub fn sched_task_with_vars(&self, node: &Arc<Node>, vars: Vars) -> Result<()>
pub fn dispatch_act(&self, act: &Act, vars: Vars) -> Result<()>
pub fn build_acts(&self, acts: &[Act], is_sequence: bool) -> Result<()>
pub fn back_task(&self, task: &Arc<Task>, paths: &Vec<Arc<Task>>) -> Result<()>
pub fn abort_task(&self, task: &Arc<Task>) -> Result<()>
Sourcepub fn undo_task(&self, task: &Arc<Task>) -> Result<()>
pub fn undo_task(&self, task: &Arc<Task>) -> Result<()>
undo task the undo task is a step task, set the task as completed and set the children acts as cancelled
pub fn emit_error(&self) -> Result<()>
pub fn emit_task(&self, task: &Arc<Task>) -> Result<()>
pub async fn emit_message(&self, msg: &Act) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Context
impl !RefUnwindSafe for Context
impl !UnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
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