pub(super) struct CheckTask {
spawned_at: &'static Location<'static>,
runtime: Runtime<'static>,
id: u64,
state: Mutex<CheckTaskState<'static>>,
}Expand description
§Safety notes
This Check type is actually valid for some (existential) 'db.
We erase this from the type system and simply use 'static in the field types.
As a result, we cannot safely access state unless we can be sure that 'db
is still in scope.
To do that, we keep a handle to check and then compare using Arc::ptr_eq to another check instance
which we have threaded through as an ordinary parameter (whose type must therefore be valid).
If we are able to supply a check that has the same underlying Arc, and its type is valid,
then we know that self.check has that same type, and that therefore the
lifetimes in self.state are valid.
Fields§
§spawned_at: &'static Location<'static>§runtime: Runtime<'static>Erased type: Check<'db>
id: u64Unique identifier for this task, used for debugging.
state: Mutex<CheckTaskState<'static>>Erased type: CheckTaskState<'chk>
Implementations§
Source§impl CheckTask
impl CheckTask
pub(super) fn new<'db>( spawned_at: &'static Location<'static>, runtime: &Runtime<'db>, future: impl Future<Output = ()> + 'db, ) -> Arc<Self>
fn replace_state( &self, new_state: CheckTaskState<'static>, ) -> CheckTaskState<'static>
fn take_state<'db>(&self, from_check: &Runtime<'db>) -> CheckTaskState<'db>
fn set_to_wait_state<'db>( &self, from_check: &Runtime<'db>, future: LocalBoxFuture<'db, ()>, )
fn waker(self: Arc<Self>) -> Waker
fn wake(self: Arc<Self>)
pub(super) fn execute(self: Arc<Self>, from_check: &Runtime<'_>)
Auto Trait Implementations§
impl !Freeze for CheckTask
impl !RefUnwindSafe for CheckTask
impl !Send for CheckTask
impl !Sync for CheckTask
impl Unpin for CheckTask
impl UnsafeUnpin for CheckTask
impl !UnwindSafe for CheckTask
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
§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