pub struct TaskPersistLayer<C, Compact> { /* private fields */ }Available on crate feature
sleep only.Expand description
A middleware layer that persists task lifecycle events.
TaskPersistLayer sends task events to a persistence channel and can be
configured to persist task results and lock tasks while they are being
processed.
§Type Parameters
C- The codec used to encode task data.Compact- The compact representation used for persisted task events.
Implementations§
Source§impl<Compact, C> TaskPersistLayer<C, Compact>
impl<Compact, C> TaskPersistLayer<C, Compact>
Sourcepub fn persist_results(self, persist_results: bool) -> Self
pub fn persist_results(self, persist_results: bool) -> Self
Configures whether task results should be persisted.
By default, task results are not persisted.
Sourcepub fn lock_tasks(self, lock_tasks: bool) -> Self
pub fn lock_tasks(self, lock_tasks: bool) -> Self
Configures whether tasks should be locked while being processed.
By default, tasks are not locked.
Trait Implementations§
Source§impl<S, Compact, C> Layer<S> for TaskPersistLayer<C, Compact>where
C: Clone,
impl<S, Compact, C> Layer<S> for TaskPersistLayer<C, Compact>where
C: Clone,
Auto Trait Implementations§
impl<C, Compact> !RefUnwindSafe for TaskPersistLayer<C, Compact>
impl<C, Compact> !UnwindSafe for TaskPersistLayer<C, Compact>
impl<C, Compact> Freeze for TaskPersistLayer<C, Compact>
impl<C, Compact> Send for TaskPersistLayer<C, Compact>
impl<C, Compact> Sync for TaskPersistLayer<C, Compact>
impl<C, Compact> Unpin for TaskPersistLayer<C, Compact>
impl<C, Compact> UnsafeUnpin for TaskPersistLayer<C, Compact>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more