Struct Lazy

#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct Lazy<F> { /* private fields */ }

Future for the lazy function.

Trait Implementations

impl<F> Unpin for Lazy<F>

impl<F, R> FusedFuture for Lazy<F> where F: FnOnce(&mut Context<'_>) -> R,

fn is_terminated(&self) -> bool

impl<F, R> Future for Lazy<F> where F: FnOnce(&mut Context<'_>) -> R,

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

impl<F: Debug> Debug for Lazy<F>

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

Auto Trait Implementations

impl<F> Freeze for Lazy<F> where Option<F>: Freeze,

impl<F> RefUnwindSafe for Lazy<F> where Option<F>: RefUnwindSafe,

impl<F> Send for Lazy<F> where Option<F>: Send,

impl<F> Sync for Lazy<F> where Option<F>: Sync,

impl<F> UnsafeUnpin for Lazy<F> where Option<F>: UnsafeUnpin,

impl<F> UnwindSafe for Lazy<F> where Option<F>: UnwindSafe,

Blanket Implementations

impl<F> IntoFuture for Lazy<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 Lazy<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<Fut> TryFutureExt for Lazy<F> where Fut: TryFuture + ?Sized,

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> From<T> for Lazy<F>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> FutureExt for Lazy<F> where T: Future + ?Sized,

impl<T, U> Into<U> for Lazy<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 Lazy<F> where U: Into<T>,

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

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

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