[][src]Struct gwasm_api::task::Task

pub struct Task { /* fields omitted */ }

Struct representing gWasm task

This type serves two purposes: 1) it can be serialized to JSON manifest required by Golem (see gWasm Task JSON), and 2) it tracks the dirs and files created on disk which contain the actual subtasks' data and params.

Example:

use gwasm_api::task::{GWasmBinary, TaskBuilder};
use std::path::Path;
use serde_json::json;
use tempfile::tempdir;

let binary = GWasmBinary {
    js: &[],
    wasm: &[],
};
let workspace = tempdir().unwrap();
let task = TaskBuilder::new(&workspace, binary).build().unwrap();
let json_manifest = json!(task);

Methods

impl Task[src]

pub fn new<S: Into<String>>(
    name: S,
    bid: f64,
    budget: Option<f64>,
    timeout: Timeout,
    subtask_timeout: Timeout,
    options: Options
) -> Self
[src]

Creates a new Task instance

pub fn name(&self) -> &str[src]

Task's name

pub fn bid(&self) -> f64[src]

Task's bid value

pub fn budget(&self) -> Option<f64>[src]

Task's budget value

pub fn timeout(&self) -> &Timeout[src]

Task's Timeout value

pub fn subtask_timeout(&self) -> &Timeout[src]

Subtasks' Timeout value

pub fn options(&self) -> &Options[src]

Options substructure

Trait Implementations

impl Clone for Task[src]

impl Debug for Task[src]

impl Serialize for Task[src]

impl TryFrom<Task> for ComputedTask[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Task

impl Send for Task

impl Sync for Task

impl Unpin for Task

impl UnwindSafe for Task

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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>,