[][src]Struct gwasm_api::task::ComputedTask

pub struct ComputedTask {
    pub name: String,
    pub bid: f64,
    pub timeout: Timeout,
    pub subtask_timeout: Timeout,
    pub subtasks: Vec<ComputedSubtask>,
}

Struct representing computed gWasm task

This struct in addition to storing some information about the computed task such as its name, or timeouts, it first and foremost contains a Vec of ComputedSubtasks.

Example:

use gwasm_api::task::{GWasmBinary, TaskBuilder, ComputedTask};
use std::path::Path;
use tempfile::tempdir;
use std::convert::TryInto;

let binary = GWasmBinary {
    js: &[],
    wasm: &[],
};
let workspace = tempdir().unwrap();
let task = TaskBuilder::try_new(&workspace, binary).unwrap().build().unwrap();
let computed_task: Result<ComputedTask, _> = task.try_into();

assert!(computed_task.is_ok());
assert!(computed_task.unwrap().subtasks.is_empty());

Fields

name: String

Task's name

bid: f64

Used task bid value

timeout: Timeout

Used task Timeout value

subtask_timeout: Timeout

Used subtask Timeout value

subtasks: Vec<ComputedSubtask>

Vec of ComputedSubtasks, ordered by subtask data insertion using TaskBuilder::push_subtask_data

Trait Implementations

impl Debug for ComputedTask[src]

impl TryFrom<Task> for ComputedTask[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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