pub struct TaskInfo {
pub dir: AbsolutePath,
pub file: AbsolutePath,
pub relative_file: PathBuf,
pub line: usize,
pub index: u32,
pub name: Option<String>,
pub heading: Option<String>,
pub targets: Vec<String>,
pub selected: Vec<String>,
pub args: Vec<String>,
pub cache_never: bool,
pub source: String,
}Expand description
The running task, as task programs see it through task and as messages name
it.
Fields§
§dir: AbsolutePathThe absolute directory of the task’s kizz.md, the task directory.
file: AbsolutePathThe absolute path of the task’s kizz.md.
relative_file: PathBufThe path of the task’s kizz.md, relative to the directory discovery started
in, as messages show it.
line: usizeThe line of the block’s opening fence, counting from 1.
index: u32The index of the task block in its kizz.md, counting from zero.
name: Option<String>The name that the block’s name= option gives the task, if it has one.
heading: Option<String>The nearest heading above the block, the task’s heading, if there is one.
targets: Vec<String>The targets on the block, in the order written.
selected: Vec<String>The requested targets that selected the task.
args: Vec<String>The task’s arguments, which programs read as task.args: empty under
kizz build. They are not part of the task program hash.
cache_never: boolWhether the block’s cache=never option marks the task, so every command of
the task runs as if it were marked always.
source: StringThe block’s Starlark source.
Implementations§
Source§impl TaskInfo
impl TaskInfo
Sourcepub fn new(task: &Task, selected: &[String]) -> Result<Self, NotAbsoluteError>
pub fn new(task: &Task, selected: &[String]) -> Result<Self, NotAbsoluteError>
The information of task, selected by the requested targets selected, with
no arguments, as kizz build runs it.
§Errors
Returns NotAbsoluteError when the task’s kizz.md path is not absolute.
Sourcepub fn for_run(task: &Task, args: Vec<String>) -> Result<Self, NotAbsoluteError>
pub fn for_run(task: &Task, args: Vec<String>) -> Result<Self, NotAbsoluteError>
The information of task as kizz run runs it: with the arguments args,
which its program reads as task.args, and an empty task.selected,
because no target selected the task.
§Errors
Returns NotAbsoluteError when the task’s kizz.md path is not absolute.
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
The name that prefixes the task’s print output: its name, else its heading,
else path/kizz.md:LINE.
Trait Implementations§
impl Eq for TaskInfo
impl StructuralPartialEq for TaskInfo
Auto Trait Implementations§
impl Freeze for TaskInfo
impl RefUnwindSafe for TaskInfo
impl Send for TaskInfo
impl Sync for TaskInfo
impl Unpin for TaskInfo
impl UnsafeUnpin for TaskInfo
impl UnwindSafe for TaskInfo
Blanket Implementations§
impl<T> AsTypeStaticRegistered for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
impl<T> HasTyVTable for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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