Struct SyncFuture

pub struct SyncFuture<F> { /* private fields */ }

Future which is Sync.

Examples

use sync_wrapper::{SyncWrapper, SyncFuture};

let fut = async { 1 };
let fut = SyncFuture::new(fut);

Implementations

impl<F: Future> SyncFuture<F>

fn new(inner: F) -> Self
fn into_inner(self) -> F

Trait Implementations

impl<F: Future> Future for SyncFuture<F>

type Output = <F as Future>::Output;
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>

impl<T> Debug for SyncFuture<T>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<F> Freeze for SyncFuture<F> where SyncWrapper<F>: Freeze,

impl<F> RefUnwindSafe for SyncFuture<F> where SyncWrapper<F>: RefUnwindSafe,

impl<F> Send for SyncFuture<F> where SyncWrapper<F>: Send,

impl<F> Sync for SyncFuture<F> where SyncWrapper<F>: Sync,

impl<F> Unpin for SyncFuture<F> where SyncWrapper<F>: Unpin,

impl<F> UnsafeUnpin for SyncFuture<F> where SyncWrapper<F>: UnsafeUnpin,

impl<F> UnwindSafe for SyncFuture<F> where SyncWrapper<F>: UnwindSafe,

Blanket Implementations

impl<F> IntoFuture for SyncFuture<F> where F: Future,

type Output = <F as Future>::Output;
type IntoFuture = F;
fn into_future(self) -> <F as IntoFuture>::IntoFuture

impl<F, T, E> TryFuture for SyncFuture<F> where F: Future<Output = Result<T, E>> + ?Sized,

type Ok = T;
type Error = E;
fn try_poll(self: Pin<&mut F>, cx: &mut Context<'_>) -> Poll<<F as Future>::Output>

impl<T> Any for SyncFuture<F> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for SyncFuture<F> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for SyncFuture<F> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> From<T> for SyncFuture<F>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for SyncFuture<F> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for SyncFuture<F> where U: Into<T>,

type Error = Infallible;
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto<U> for SyncFuture<F> where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>