Struct Shared
struct Shared<Fut: Future> { ... }
Future for the shared method.
Implementations
impl<Fut> Shared<Fut>
fn peek(self: &Self) -> Option<&<Fut as >::Output>Returns
Somecontaining a reference to thisShared's output if it has already been computed by a clone orNoneif it hasn't been computed yet or thisSharedalready returned its output frompoll.fn downgrade(self: &Self) -> Option<WeakShared<Fut>>Creates a new
WeakSharedfor thisShared.Returns
Noneif it has already been polled to completion.fn strong_count(self: &Self) -> Option<usize>Gets the number of strong pointers to this allocation.
Returns
Noneif 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.
fn weak_count(self: &Self) -> Option<usize>Gets the number of weak pointers to this allocation.
Returns
Noneif 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.
fn ptr_hash<H: Hasher>(self: &Self, state: &mut H)Hashes the internal state of this
Sharedin a way that's compatible withptr_eq.fn ptr_eq(self: &Self, rhs: &Self) -> boolReturns
trueif the twoShareds point to the same future (in a vein similar toArc::ptr_eq).Returns
falseif eitherSharedhas terminated.
impl<F> IntoFuture for Shared<Fut>
fn into_future(self: Self) -> <F as IntoFuture>::IntoFuture
impl<F, T, E> TryFuture for Shared<Fut>
fn try_poll(self: Pin<&mut F>, cx: &mut Context<'_>) -> Poll<<F as Future>::Output>
impl<Fut> Clone for Shared<Fut>
fn clone(self: &Self) -> Self
impl<Fut> Drop for Shared<Fut>
fn drop(self: &mut Self)
impl<Fut> Freeze for Shared<Fut>
impl<Fut> FusedFuture for Shared<Fut>
fn is_terminated(self: &Self) -> bool
impl<Fut> Future for Shared<Fut>
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<<Self as >::Output>
impl<Fut> RefUnwindSafe for Shared<Fut>
impl<Fut> Send for Shared<Fut>
impl<Fut> Sync for Shared<Fut>
impl<Fut> TryFutureExt for Shared<Fut>
impl<Fut> Unpin for Shared<Fut>
impl<Fut> UnsafeUnpin for Shared<Fut>
impl<Fut> UnwindSafe for Shared<Fut>
impl<Fut: Future> Debug for Shared<Fut>
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl<T> Any for Shared<Fut>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Shared<Fut>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Shared<Fut>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Shared<Fut>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for Shared<Fut>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> FutureExt for Shared<Fut>
impl<T> ToOwned for Shared<Fut>
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for Shared<Fut>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Shared<Fut>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Shared<Fut>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>