Struct futures_util::future::Shared
source · pub struct Shared<Fut: Future> { /* private fields */ }
Expand description
Future for the shared
method.
Implementations§
sourcepub fn downgrade(&self) -> Option<WeakShared<Fut>>
pub fn downgrade(&self) -> Option<WeakShared<Fut>>
Creates a new WeakShared
for this Shared
.
Returns None
if it has already been polled to completion.
sourcepub fn strong_count(&self) -> Option<usize>
pub fn strong_count(&self) -> Option<usize>
Gets the number of strong pointers to this allocation.
Returns None
if it has already been polled to completion.
Safety
This method by itself is safe, but using it correctly requires extra care. Another thread can change the strong count at any time, including potentially between calling this method and acting on the result.
sourcepub fn weak_count(&self) -> Option<usize>
pub fn weak_count(&self) -> Option<usize>
Gets the number of weak pointers to this allocation.
Returns None
if it has already been polled to completion.
Safety
This method by itself is safe, but using it correctly requires extra care. Another thread can change the weak count at any time, including potentially between calling this method and acting on the result.
Trait Implementations§
source§fn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
true
if the underlying future should no longer be polled.