Skip to main content

TaskInfo

Struct TaskInfo 

Source
pub struct TaskInfo { /* private fields */ }

Implementations§

Source§

impl TaskInfo

Source

pub fn id(&self) -> TaskID

Source

pub fn project_id(&self) -> Option<ProjectID>

Source

pub fn description(&self) -> &str

Source

pub fn workflow(&self) -> &str

Source

pub fn status(&self) -> &Option<String>

Source

pub async fn set_status( &mut self, client: &Client, status: &str, ) -> Result<(), Error>

Source

pub fn stages(&self) -> HashMap<String, Stage>

Source

pub async fn update_stage( &mut self, client: &Client, stage: &str, status: &str, message: &str, percentage: u8, ) -> Result<(), Error>

Source

pub async fn set_stages( &mut self, client: &Client, stages: &[(&str, &str)], ) -> Result<(), Error>

Source

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.

Source

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 to None.
  • progress - Optional progress channel. Emits Progress { current, total, status: None } events as bytes are streamed to the server. total equals the file size in bytes; current tracks 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.

Source

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; None or Some("") targets the root.
  • output_path - Local path to write the downloaded file.
  • progress - Optional progress channel; events carry bytes received and Content-Length total (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.

Source

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 a Parameter (arbitrary JSON).
  • params - Optional chart-rendering parameters as a Parameter.
§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.

Source

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; None returns 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.

Source

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.

Source

pub fn created(&self) -> &DateTime<Utc>

Source

pub fn completed(&self) -> &DateTime<Utc>

Trait Implementations§

Source§

impl Clone for TaskInfo

Source§

fn clone(&self) -> TaskInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TaskInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for TaskInfo

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for TaskInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Key for T
where T: Clone,

Source§

fn align() -> usize

The alignment necessary for the key. Must return a power of two.
Source§

fn size(&self) -> usize

The size of the key in bytes.
Source§

unsafe fn init(&self, ptr: *mut u8)

Initialize the key in the given memory location. Read more
Source§

unsafe fn get<'a>(ptr: *const u8) -> &'a T

Get a reference to the key from the given memory location. Read more
Source§

unsafe fn drop_in_place(ptr: *mut u8)

Drop the key in place. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToCompactString for T
where T: Display,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,