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>)
pub fn dispatch_act(&self, act: &Act, is_hook_event: bool) -> Result<()>
pub fn build_acts(&self, acts: &[Act], is_sequence: bool) -> Result<()>
pub fn dispatch_acts(&self, acts: Vec<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 fn emit_message(&self, msg: &Act) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Context
impl !RefUnwindSafe for Context
impl Send for Context
impl !Sync for Context
impl Unpin for Context
impl !UnwindSafe 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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