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
sourcefn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
Returns true
if the underlying future should no longer be polled.
Auto Trait Implementations
Blanket Implementations
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
type IntoFuture = F
type IntoFuture = F
Which kind of future are we turning this into?
sourcefn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Creates a future from a value. Read more