pub enum TaskPersistence {
Persistent,
Transient,
Local,
}
Variants§
Persistent
Tasks that may be persisted across sessions using serialization.
Transient
Tasks that will be persisted in memory for the life of this session, but won’t persist between sessions.
This is used for root tasks and tasks with an argument of
type TransientValue
or
TransientInstance
.
Local
Tasks that are persisted only for the lifetime of the nearest non-Local
parent caller.
This task does not have a unique task id, and is not shared with the backend. Instead it uses the parent task’s id.
This is useful for functions that have a low cache hit rate. Those functions could be converted to non-task functions, but that would break their function signature. This provides a mechanism for skipping caching without changing the function signature.
Trait Implementations§
Source§impl Clone for TaskPersistence
impl Clone for TaskPersistence
Source§fn clone(&self) -> TaskPersistence
fn clone(&self) -> TaskPersistence
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for TaskPersistence
impl Debug for TaskPersistence
Source§impl<'de> Deserialize<'de> for TaskPersistence
impl<'de> Deserialize<'de> for TaskPersistence
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for TaskPersistence
impl Hash for TaskPersistence
Source§impl PartialEq for TaskPersistence
impl PartialEq for TaskPersistence
Source§impl Serialize for TaskPersistence
impl Serialize for TaskPersistence
impl Copy for TaskPersistence
impl Eq for TaskPersistence
impl StructuralPartialEq for TaskPersistence
Auto Trait Implementations§
impl Freeze for TaskPersistence
impl RefUnwindSafe for TaskPersistence
impl Send for TaskPersistence
impl Sync for TaskPersistence
impl Unpin for TaskPersistence
impl UnwindSafe for TaskPersistence
Blanket Implementations§
§impl<T> Any for Twhere
T: Any,
impl<T> Any for Twhere
T: Any,
fn get_type_id(&self) -> TypeId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DynamicEqHash for T
impl<T> DynamicEqHash for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more