[][src]Struct nature_db::RawTask

pub struct RawTask {
    pub task_id: String,
    pub task_key: String,
    pub task_type: i8,
    pub task_for: String,
    pub task_state: i8,
    pub data: String,
    pub create_time: NaiveDateTime,
    pub execute_time: NaiveDateTime,
    pub retried_times: i16,
}

Fields

task_id: Stringtask_key: Stringtask_type: i8task_for: Stringtask_state: i8data: Stringcreate_time: NaiveDateTimeexecute_time: NaiveDateTimeretried_times: i16

Implementations

impl RawTask[src]

pub fn new<T: Serialize + Debug>(
    task: &T,
    task_key: &str,
    task_type: i8,
    task_for: &str
) -> Result<RawTask>
[src]

pub fn from_str(
    json: &str,
    task_key: &str,
    task_type: i8,
    task_for: &str
) -> Result<RawTask>
[src]

pub fn finish_old<FI, FD>(
    &mut self,
    old: &RawTask,
    _dao_insert: FI,
    _dao_delete: FD
) -> Result<usize> where
    FI: Fn(&RawTask) -> Result<usize>,
    FD: Fn(&[u8]) -> Result<usize>, 
[src]

for performance reason, one-to-one carry which we can reuse the beginning carry to finish all flows. That way we need not to communicate with DB for create new and delete old carrier. But for failure we must redo from beginning. but I think it has small chance. Another disadvantage is the failure information will be attached to the beginning.

pub async fn save_batch<T, '_, '_, '_>(
    news: &'_ mut Vec<RawTask>,
    old_id: &'_ str,
    task: &'_ T
) -> Result<()> where
    T: TaskDao
[src]

pub fn task_string(&self) -> String[src]

Trait Implementations

impl Clone for RawTask[src]

impl Debug for RawTask[src]

impl Default for RawTask[src]

impl<'de> Deserialize<'de> for RawTask[src]

impl Eq for RawTask[src]

impl From<Row> for RawTask[src]

impl Hash for RawTask[src]

impl Into<Vec<(String, Value)>> for RawTask[src]

impl PartialEq<RawTask> for RawTask[src]

impl Serialize for RawTask[src]

impl StructuralEq for RawTask[src]

impl StructuralPartialEq for RawTask[src]

Auto Trait Implementations

impl RefUnwindSafe for RawTask

impl Send for RawTask

impl Sync for RawTask

impl Unpin for RawTask

impl UnwindSafe for RawTask

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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?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>,