A value that may or may not be ready yet.
Poll<T>
most commonly appears as the return type of an function that checks the current status of an asynchronous operation. If the operation has completed, it returns with Ready(value)
. Otherwise, it returns Pending
to indicate that the operations has not yet completed, and the caller should try again in the future.
Poll<T>
itself is "plain old data" and does not change on its own. To check the current status of an operation, the caller must invoke the Poll<T>
returning function again and examine the newly returned Poll<T>
.
Public Types | |
using | value_type = T |
Public Member Functions | |
Poll ()=delete | |
Basic constructors. | |
constexpr | Poll (const Poll &)=default |
constexpr Poll & | operator= (const Poll &)=default |
constexpr | Poll (Poll &&)=default |
constexpr Poll & | operator= (Poll &&)=default |
template<typename U , internal_poll::EnableIfImplicitlyConvertible< value_type, const U & > = 0> | |
constexpr | Poll (const Poll< U > &other) |
template<typename U , internal_poll::EnableIfExplicitlyConvertible< value_type, const U & > = 0> | |
constexpr | Poll (const Poll< U > &other) |
template<typename U , internal_poll::EnableIfImplicitlyConvertible< value_type, U && > = 0> | |
constexpr | Poll (Poll< U > &&other) |
template<typename U , internal_poll::EnableIfExplicitlyConvertible< value_type, U && > = 0> | |
constexpr | Poll (Poll< U > &&other) |
template<typename U = value_type, internal_poll::EnableIfImplicitlyInitializable< value_type, U > = 0> | |
constexpr | Poll (U &&u) |
template<typename U = value_type, internal_poll::EnableIfExplicitlyInitializable< value_type, U > = 0> | |
constexpr | Poll (U &&u) |
template<typename... Args> | |
constexpr | Poll (std::in_place_t, Args &&... args) |
constexpr | Poll (value_type &&value) |
constexpr Poll & | operator= (value_type &&value) |
constexpr | Poll (PendingType) noexcept |
constexpr Poll & | operator= (PendingType) noexcept |
constexpr bool | IsReady () const noexcept |
Returns whether or not this value is Ready . | |
constexpr bool | IsPending () const noexcept |
Returns whether or not this value is Pending . | |
constexpr Poll | Readiness () const noexcept |
constexpr value_type & | value () &noexcept |
constexpr const value_type & | value () const &noexcept |
constexpr value_type && | value () &&noexcept |
constexpr const value_type && | value () const &&noexcept |
constexpr const value_type * | operator-> () const noexcept |
constexpr value_type * | operator-> () noexcept |
constexpr const value_type & | operator* () const &noexcept |
constexpr value_type & | operator* () &noexcept |
constexpr const value_type && | operator* () const &&noexcept |
constexpr value_type && | operator* () &&noexcept |
constexpr void | IgnorePoll () const |