[−][src]Struct nature_db::RawTask
Fields
task_id: String
task_key: String
task_type: i8
task_for: String
task_state: i8
data: String
create_time: NaiveDateTime
execute_time: NaiveDateTime
retried_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]
task: &T,
task_key: &str,
task_type: i8,
task_for: &str
) -> Result<RawTask>
pub fn from_str(
json: &str,
task_key: &str,
task_type: i8,
task_for: &str
) -> Result<RawTask>
[src]
json: &str,
task_key: &str,
task_type: i8,
task_for: &str
) -> Result<RawTask>
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]
&mut self,
old: &RawTask,
_dao_insert: FI,
_dao_delete: FD
) -> Result<usize> where
FI: Fn(&RawTask) -> Result<usize>,
FD: Fn(&[u8]) -> Result<usize>,
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]
news: &'_ mut Vec<RawTask>,
old_id: &'_ str,
task: &'_ T
) -> Result<()> where
T: TaskDao,
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]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for RawTask
[src]
impl From<Row> for RawTask
[src]
impl Hash for RawTask
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Into<Vec<(String, Value)>> for RawTask
[src]
impl PartialEq<RawTask> for RawTask
[src]
impl Serialize for RawTask
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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]
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[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>,