pub struct TaskInfo { /* private fields */ }Implementations§
Source§impl TaskInfo
impl TaskInfo
pub fn id(&self) -> TaskID
pub fn project_id(&self) -> Option<ProjectID>
pub fn description(&self) -> &str
pub fn workflow(&self) -> &str
pub fn status(&self) -> &Option<String>
pub async fn set_status( &mut self, client: &Client, status: &str, ) -> Result<(), Error>
pub fn stages(&self) -> HashMap<String, Stage>
pub async fn update_stage( &mut self, client: &Client, stage: &str, status: &str, message: &str, percentage: u8, ) -> Result<(), Error>
pub async fn set_stages( &mut self, client: &Client, stages: &[(&str, &str)], ) -> Result<(), Error>
Sourcepub async fn data_list(&self, client: &Client) -> Result<TaskDataList, Error>
pub async fn data_list(&self, client: &Client) -> Result<TaskDataList, Error>
Lists the data artefacts (non-chart files) attached to this task.
The returned TaskDataList::data map is keyed by folder name.
Trace files are also surfaced separately in traces.
§Arguments
client- The authenticated client instance.
§Returns
A TaskDataList where data maps folder names to lists of filenames.
§Errors
Returns Error::TaskNotFound if the task does not exist,
Error::PermissionDenied if authorization fails, or
Error::RpcError for other server-side failures.
Sourcepub async fn upload_data(
&self,
client: &Client,
path: &Path,
folder: Option<&str>,
progress: Option<Sender<Progress>>,
) -> Result<(), Error>
pub async fn upload_data( &self, client: &Client, path: &Path, folder: Option<&str>, progress: Option<Sender<Progress>>, ) -> Result<(), Error>
Uploads a data file to this task.
§Arguments
client- The authenticated client instance.path- Local file path to upload. The filename is derived from the path’s last component.folder- Optional logical subdirectory under the task data root. Empty-string is normalised toNone.progress- Optional progress channel. EmitsProgress { current, total, status: None }events as bytes are streamed to the server.totalequals the file size in bytes;currenttracks bytes sent.
§Returns
Ok(()) on success.
§Errors
Returns Error::InvalidParameters if the path has no valid filename,
Error::TaskNotFound if the task does not exist,
Error::PermissionDenied if authorization fails, or
Error::RpcError for other server-side failures.
Sourcepub async fn download_data(
&self,
client: &Client,
file: &str,
folder: Option<&str>,
output_path: &Path,
progress: Option<Sender<Progress>>,
) -> Result<(), Error>
pub async fn download_data( &self, client: &Client, file: &str, folder: Option<&str>, output_path: &Path, progress: Option<Sender<Progress>>, ) -> Result<(), Error>
Streams a data file from this task to output_path.
folder is the logical subdirectory under the task data root;
pass None (or Some("")) to download from the root.
Progress is reported via the optional progress channel; values
match the server-reported Content-Length when available.
§Arguments
client- The authenticated client instance.file- Filename to download.folder- Optional logical subdirectory under the task data root;NoneorSome("")targets the root.output_path- Local path to write the downloaded file.progress- Optional progress channel; events carry bytes received andContent-Lengthtotal (0 if server omits it).
§Returns
Ok(()) when the file has been written and flushed.
§Errors
Returns Error::TaskNotFound if the task does not exist,
Error::PermissionDenied if authorization fails,
Error::RpcError if the server returns a JSON-RPC error envelope
(decoded from the Content-Type: application/json body), or
Error::IoError on file write failures. Legitimate JSON file
payloads (e.g. trace JSON, chart bodies) are persisted normally
rather than treated as an error.
Sourcepub async fn add_chart(
&self,
client: &Client,
group: &str,
name: &str,
data: Parameter,
params: Option<Parameter>,
) -> Result<(), Error>
pub async fn add_chart( &self, client: &Client, group: &str, name: &str, data: Parameter, params: Option<Parameter>, ) -> Result<(), Error>
Adds (or overwrites) a chart under (group, name) for this task.
data is the chart body — arbitrary JSON via the Parameter enum.
params are optional chart-rendering parameters.
The server’s task.chart.add is upsert semantics: a chart with the
same (group, name) is overwritten.
Returns () — the server does not return a chart id. Charts are
identified by (group, name) and the same key overwrites on subsequent
calls.
§Arguments
client- The authenticated client instance.group- Chart group name (non-empty).name- Chart name within the group (non-empty).data- Chart body as aParameter(arbitrary JSON).params- Optional chart-rendering parameters as aParameter.
§Returns
Ok(()) on success.
§Errors
Returns Error::InvalidParameters if group or name is empty,
Error::TaskNotFound if the task does not exist,
Error::PermissionDenied if authorization fails, or
Error::RpcError for other server-side failures.
Sourcepub async fn list_charts(
&self,
client: &Client,
group: Option<&str>,
) -> Result<TaskDataList, Error>
pub async fn list_charts( &self, client: &Client, group: Option<&str>, ) -> Result<TaskDataList, Error>
Lists charts attached to this task, optionally filtered to a single group.
Returns the same TaskDataList shape as data_list, where the data
map encodes group -> [chart_filenames].
§Arguments
client- The authenticated client instance.group- Optional group name to filter results;Nonereturns all groups.
§Returns
A TaskDataList where data maps group names to lists of chart filenames.
§Errors
Returns Error::TaskNotFound if the task does not exist,
Error::PermissionDenied if authorization fails, or
Error::RpcError for other server-side failures.
Sourcepub async fn get_chart(
&self,
client: &Client,
group: &str,
name: &str,
) -> Result<Parameter, Error>
pub async fn get_chart( &self, client: &Client, group: &str, name: &str, ) -> Result<Parameter, Error>
Fetches the raw chart body for (group, name) on this task.
The returned Parameter is the deserialized chart JSON; the caller
is responsible for interpreting the shape (line, bar, scatter, etc.).
§Arguments
client- The authenticated client instance.group- Chart group name (non-empty).name- Chart name within the group (non-empty).
§Returns
The chart body deserialized as a Parameter.
§Errors
Returns Error::InvalidParameters if group or name is empty,
Error::TaskNotFound if the task does not exist,
Error::PermissionDenied if authorization fails, or
Error::RpcError for other server-side failures.
pub fn created(&self) -> &DateTime<Utc>
pub fn completed(&self) -> &DateTime<Utc>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskInfo
impl<'de> Deserialize<'de> for TaskInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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§
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
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> ⓘ
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 moreSource§impl<T> Key for Twhere
T: Clone,
impl<T> Key for Twhere
T: Clone,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more