Struct task::WeakTaskRef
source · pub struct WeakTaskRef(/* private fields */);
Expand description
A weak reference to a shared Task reference (TaskRef
).
WeakTaskRef
and TaskRef
behave analogously to Weak
and Arc
;
see the documentation of Weak
for more detail.
This is created via TaskRef::downgrade()
.
Implementations§
source§impl WeakTaskRef
impl WeakTaskRef
sourcepub fn upgrade(&self) -> Option<TaskRef>
pub fn upgrade(&self) -> Option<TaskRef>
Attempts to upgrade this WeakTaskRef
to a TaskRef
; see Weak::upgrade()
.
Returns None
if the TaskRef
has already been dropped, meaning that the
Task
itself no longer exists has been exited, cleaned up, and fully dropped.
Trait Implementations§
source§impl Clone for WeakTaskRef
impl Clone for WeakTaskRef
source§fn clone(&self) -> WeakTaskRef
fn clone(&self) -> WeakTaskRef
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for WeakTaskRef
impl Send for WeakTaskRef
impl Sync for WeakTaskRef
impl Unpin for WeakTaskRef
impl !UnwindSafe for WeakTaskRef
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