#[non_exhaustive]pub enum TaskPresence {
Present {
owner: TaskOwner,
},
Expired {
owner: TaskOwner,
},
Missing,
}Expand description
Whether a task is present, expired, or was never known.
Option collapses the last two, so an application retaining expired
tombstones cannot tell a caller “that task expired” rather than “no such
task” (#1249).
§The owner is carried for a reason
Expired keeps the owner because authorization has to happen before the
distinction is revealed. A present or expired task belonging to another
principal must remain indistinguishable from Missing to that caller, or
tasks/get becomes an existence oracle: anyone could probe ids and learn
which ones belong to somebody. Only the matching owner sees Expired.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Present
The task exists and has not expired.
Expired
The task existed and its TTL elapsed.
Only reported by a store that retains expired records. One that drops
them answers Missing, which is correct for it.
Missing
No such task, or the store no longer retains it.
Implementations§
Trait Implementations§
Source§impl Clone for TaskPresence
impl Clone for TaskPresence
Source§fn clone(&self) -> TaskPresence
fn clone(&self) -> TaskPresence
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TaskPresence
impl Debug for TaskPresence
impl Eq for TaskPresence
Source§impl PartialEq for TaskPresence
impl PartialEq for TaskPresence
impl StructuralPartialEq for TaskPresence
Auto Trait Implementations§
impl Freeze for TaskPresence
impl RefUnwindSafe for TaskPresence
impl Send for TaskPresence
impl Sync for TaskPresence
impl Unpin for TaskPresence
impl UnsafeUnpin for TaskPresence
impl UnwindSafe for TaskPresence
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.