std1.0.0-beta-7 SafeC docs

std :: async::future

Struct std::Poll

#include <std/async/future.h> source

generic<T> struct Poll {
    T value;
}

The result of one poll: Ready with a value, or Pending (value unset).

Fields

§T valuesource

set when ready_ == 1

Methods

§static struct Poll<T> ready(T v)source · definition
§static struct Poll<T> pending()source · definition
§int is_ready() constsource · definition
§int is_pending() constsource · definition
§?T take() consumesource · definition

The value if Ready, null if Pending. Consumes the Poll.

§T unwrap() consumesource · definition

The value; panics if Pending. Consumes the Poll.

§void drop() if (needs_drop(T))source · definition

A Poll owns its value when T owns something.