Struct dyer::component::task::Task[][src]

pub struct Task<T> where
    T: Serialize + for<'a> Deserialize<'a> + Debug + Clone
{ pub uri: String, pub method: String, pub headers: HashMap<String, String>, pub body: Option<HashMap<String, String>>, pub able: f64, pub trys: u8, pub parser: String, pub targs: Option<T>, }

Task, as it means, a scheduled job to be done, contains most infomation of Request. For the purposes of extensive compatibility, A generic parameter T is required in dealing with it.

Fields

uri: Stringmethod: Stringheaders: HashMap<String, String>

additional headers if necessary

body: Option<HashMap<String, String>>

Formdata or other request parameter stored here

able: f64

checkpoint in seconds by which this Task is allowed to be executed

trys: u8

times that this Task has failed, by default, the threshold is 2, customize it in AppArg

parser: String

the index to get the parser parsing the Response when it’s done

targs: Option<T>

additional arguments for extensive application

Implementations

impl<T> Task<T> where
    T: Serialize + for<'a> Deserialize<'a> + Debug + Clone
[src]

pub fn stored(path: &str, task: &mut Arc<Mutex<Vec<Task<T>>>>)[src]

store unfinished or extra Tasks,

pub fn load(path: &str) -> Vec<Task<T>>[src]

load unfinished or extra Tasks

Trait Implementations

impl<T: Clone> Clone for Task<T> where
    T: Serialize + for<'a> Deserialize<'a> + Debug + Clone
[src]

impl<T: Debug> Debug for Task<T> where
    T: Serialize + for<'a> Deserialize<'a> + Debug + Clone
[src]

impl<T> Default for Task<T> where
    T: Serialize + for<'a> Deserialize<'a> + Clone + Debug
[src]

impl<'de, T> Deserialize<'de> for Task<T> where
    T: Serialize + for<'a> Deserialize<'a> + Debug + Clone,
    T: Serialize + for<'a> Deserialize<'a> + Debug + Clone
[src]

impl<T> Serialize for Task<T> where
    T: Serialize + for<'a> Deserialize<'a> + Debug + Clone,
    T: Serialize + for<'a> Deserialize<'a> + Debug + Clone
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Task<T> where
    T: RefUnwindSafe

impl<T> Send for Task<T> where
    T: Send

impl<T> Sync for Task<T> where
    T: Sync

impl<T> Unpin for Task<T> where
    T: Unpin

impl<T> UnwindSafe for Task<T> where
    T: UnwindSafe

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

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.