pub struct Shared<Fut>where
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.Auto Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn map<U, F>(self, f: F) -> Map<Self, F> ⓘ
fn map<U, F>(self, f: F) -> Map<Self, F> ⓘ
Source§fn map_into<U>(self) -> MapInto<Self, U> ⓘ
fn map_into<U>(self) -> MapInto<Self, U> ⓘ
Source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> ⓘ
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> ⓘ
f
. Read moreSource§fn left_future<B>(self) -> Either<Self, B> ⓘ
fn left_future<B>(self) -> Either<Self, B> ⓘ
Source§fn right_future<A>(self) -> Either<A, Self> ⓘ
fn right_future<A>(self) -> Either<A, Self> ⓘ
Source§fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
Source§fn flatten(self) -> Flatten<Self> ⓘ
fn flatten(self) -> Flatten<Self> ⓘ
Source§fn flatten_stream(self) -> FlattenStream<Self>
fn flatten_stream(self) -> FlattenStream<Self>
Source§fn fuse(self) -> Fuse<Self> ⓘwhere
Self: Sized,
fn fuse(self) -> Fuse<Self> ⓘwhere
Self: Sized,
poll
will never again be called once it has
completed. This method can be used to turn any Future
into a
FusedFuture
. Read moreSource§fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ
fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ
Source§fn catch_unwind(self) -> CatchUnwind<Self> ⓘwhere
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self> ⓘwhere
Self: Sized + UnwindSafe,
Source§fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
()
on completion and sends
its output to another future on a separate task. Read moreSource§fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
Source§fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
Source§fn unit_error(self) -> UnitError<Self> ⓘwhere
Self: Sized,
fn unit_error(self) -> UnitError<Self> ⓘwhere
Self: Sized,
Future<Output = T>
into a
TryFuture<Ok = T, Error = ()
>.Source§fn never_error(self) -> NeverError<Self> ⓘwhere
Self: Sized,
fn never_error(self) -> NeverError<Self> ⓘwhere
Self: Sized,
Future<Output = T>
into a
TryFuture<Ok = T, Error = Never
>.Source§impl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Source§type IntoFuture = F
type IntoFuture = F
Source§fn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
Source§impl<Fut> TryFutureExt for Fut
impl<Fut> TryFutureExt for Fut
Source§fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok>
fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok>
Source§fn map_ok<T, F>(self, f: F) -> MapOk<Self, F> ⓘ
fn map_ok<T, F>(self, f: F) -> MapOk<Self, F> ⓘ
Source§fn map_ok_or_else<T, E, F>(self, e: E, f: F) -> MapOkOrElse<Self, F, E> ⓘ
fn map_ok_or_else<T, E, F>(self, e: E, f: F) -> MapOkOrElse<Self, F, E> ⓘ
Source§fn map_err<E, F>(self, f: F) -> MapErr<Self, F> ⓘ
fn map_err<E, F>(self, f: F) -> MapErr<Self, F> ⓘ
Source§fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F> ⓘ
fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F> ⓘ
Source§fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F> ⓘ
fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F> ⓘ
Source§fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F> ⓘ
fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F> ⓘ
Source§fn inspect_err<F>(self, f: F) -> InspectErr<Self, F> ⓘ
fn inspect_err<F>(self, f: F) -> InspectErr<Self, F> ⓘ
Source§fn try_flatten(self) -> TryFlatten<Self, Self::Ok> ⓘ
fn try_flatten(self) -> TryFlatten<Self, Self::Ok> ⓘ
Source§fn try_flatten_stream(self) -> TryFlattenStream<Self>
fn try_flatten_stream(self) -> TryFlattenStream<Self>
Source§fn unwrap_or_else<F>(self, f: F) -> UnwrapOrElse<Self, F> ⓘ
fn unwrap_or_else<F>(self, f: F) -> UnwrapOrElse<Self, F> ⓘ
Source§fn into_future(self) -> IntoFuture<Self> ⓘwhere
Self: Sized,
fn into_future(self) -> IntoFuture<Self> ⓘwhere
Self: Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 16 bytes