[][src]Struct kas::Future

pub struct Future<T: 'static>(_);

A future value, pending UI operation

This is a simpler form of future than the std::future::Future trait, relying on the UI event system for execution. It also does not come with a waker; since calling into widget code is only possible through the event system, an UpdateHandle should be used to wake the recipient.

Implementations

impl<T: 'static> Future<T>[src]

pub fn new_box_fnmut<U: 'static>(
    f: Box<dyn FnMut(&mut U) -> T>
) -> (Self, Box<dyn FnMut(&mut U)>)
[src]

Construct, given a boxed closure to produce the final value

Returns the future and a finish closure to set the value when done.

pub fn is_finished(&self) -> bool[src]

Check whether this is finished

pub fn try_finish(self) -> Result<T, Self>[src]

Returns a result on completion

It may be worth checking Future::is_finished before calling this method.

Trait Implementations

impl<T: Debug + 'static> Debug for Future<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Future<T>

impl<T> !Send for Future<T>

impl<T> !Sync for Future<T>

impl<T> Unpin for Future<T>

impl<T> !UnwindSafe for Future<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.