[−][src]Struct gwasm_api::task::Task
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]
name: S,
bid: f64,
budget: Option<f64>,
timeout: Timeout,
subtask_timeout: Timeout,
options: Options
) -> Self
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]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl TryFrom<Task> for ComputedTask
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,